Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

HTTP POST not working?

For general discussion related FlowStone

HTTP POST not working?

Postby CoreStylerz » Fri Nov 09, 2012 4:06 pm

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
CoreStylerz
 
Posts: 327
Joined: Sun Jan 22, 2012 2:19 am
Location: italy

Re: HTTP POST not working?

Postby support » Fri Nov 09, 2012 6:17 pm

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 1041 times


There is more information on HTTP Post here: http://en.wikipedia.org/wiki/POST_%28HTTP%29
User avatar
support
 
Posts: 151
Joined: Fri Sep 07, 2012 2:10 pm

Re: HTTP POST not working?

Postby Drnkhobo » Fri Nov 09, 2012 7:15 pm

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. . .
Drnkhobo
 
Posts: 312
Joined: Sun Aug 19, 2012 7:13 pm
Location: ZA

Re: HTTP POST not working?

Postby CoreStylerz » Fri Nov 09, 2012 9:49 pm

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

Re: HTTP POST not working?

Postby CoreStylerz » Tue Nov 13, 2012 12:07 pm

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
CoreStylerz
 
Posts: 327
Joined: Sun Jan 22, 2012 2:19 am
Location: italy

Re: HTTP POST not working?

Postby admin » Tue Nov 13, 2012 12:26 pm

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?
User avatar
admin
Site Admin
 
Posts: 231
Joined: Tue May 11, 2010 6:30 pm


Return to General

Who is online

Users browsing this forum: No registered users and 76 guests