HTTP POST not working?

For general discussion related FlowStone
Post Reply
User avatar
CoreStylerz
Posts: 327
Joined: Sun Jan 22, 2012 2:19 am
Location: italy
Contact:

HTTP POST not working?

Post by CoreStylerz »

Dear support.
I have a great issue with HTTP POST primitive, because it does not send nothing.
I connected:
[string]http://www.website.com[string]
[string]/folder/folder2/script.php[string]
[array] var names [array]
[array] var data [array]
[trigger] trig. button [trigger].

All is setup as in the component reference. but it do nothing.
I tried to disable firewall. Nothing.
How i can solve this?

And another thing, how do i return data from php to the data received(string)?
Need my support for app development, website or custom scripts?
PM me if you are interested.
Experienced Java, J2EE, PHP, Javascript, Angular, Cloud Solutions developer.
User avatar
support
Posts: 151
Joined: Fri Sep 07, 2012 2:10 pm

Re: HTTP POST not working?

Post by support »

Just tested it here and it all works ok?

Do you have an active php script for the HTTP to talk to? (you have to write this yourself on your server)

Here's an example: SendEmail.php

<?php
//Capture data from $_POST array
$to = $_POST['to'];
//define the subject of the email
$subject = $_POST['subject'];
//define the message to be sent. Each line should be separated with \n
$message = $_POST['Message'];
$ID = $_POST['ID'];

//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: noreply@myemail.com\r\nReply-To: noreply@myemail.com";
//send the email
$mail_sent = @mail( $to, $subject, $message, $headers );
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
echo $mail_sent ? "Mail sent" : "Mail failed";
?>

Here is FlowStone example to talk to this server script:
Send Email via HTTP.fsm
(378 Bytes) Downloaded 1164 times


There is more information on HTTP Post here: http://en.wikipedia.org/wiki/POST_%28HTTP%29
Drnkhobo
Posts: 312
Joined: Sun Aug 19, 2012 7:13 pm
Location: ZA

Re: HTTP POST not working?

Post by Drnkhobo »

Hey Support, Ive tried your example and just added a bit more text to the message field.
It sends the mail but with only 7 characters. . . ?

I used your example EXACTLY so im confused why its sending only with 7 chars?
I also get a popup displaying my port number, is that correct?
Im using FS2 tho. . .
User avatar
CoreStylerz
Posts: 327
Joined: Sun Jan 22, 2012 2:19 am
Location: italy
Contact:

Re: HTTP POST not working?

Post by CoreStylerz »

Hi thanks for fast reply.
Yes I already done a script in PHP that collect data from post and store in db, then should give a response.
The script use correctly $var = $_POST['var']..

What does not work is sending from fs. I can't understand what does block since the primitive produce no log or debug of what it does.
May the strings are too big?

I will send you details via pm with fan and links to script including source so you can have a look.

At first I though that the problem was made by local server, web matrix (iss + apache2), because it use ports.
Need my support for app development, website or custom scripts?
PM me if you are interested.
Experienced Java, J2EE, PHP, Javascript, Angular, Cloud Solutions developer.
User avatar
CoreStylerz
Posts: 327
Joined: Sun Jan 22, 2012 2:19 am
Location: italy
Contact:

Re: HTTP POST not working?

Post by CoreStylerz »

Ok.. i entered http:// in the url and wasn't working
Need my support for app development, website or custom scripts?
PM me if you are interested.
Experienced Java, J2EE, PHP, Javascript, Angular, Cloud Solutions developer.
User avatar
admin
Site Admin
Posts: 231
Joined: Tue May 11, 2010 6:30 pm

Re: HTTP POST not working?

Post by admin »

I used your example EXACTLY so im confused why its sending only with 7 chars?
I also get a popup displaying my port number, is that correct?
Im using FS2 tho. . .


There was a bug in V2 that caused the pop up (now fixed in V3). You can test it in FS V3 FREE or upgrade.

There is no limit on characters we used this a lot and sent large data sets around using HTTP Post?
Post Reply