Making a simple HTTP POST with EB-023

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
milea
Flowcode V4 User
Posts: 16
Joined: Fri Apr 24, 2009 11:56 am
Contact:

Making a simple HTTP POST with EB-023

Post by milea »

I'm trying to make simple HTTP command ''POST'' but with no success.
I use format:

POST /page.php HTTP/1.1/r/n
HOST: mypage.com /r/n
Content-Type: application/x-www-form-urlencoded/r/n
/r/n
var1=1&var2=2&var3=3


I'm working with EB-023 internet board (with old W3100A ).
I use TCP_IP component Initialization->Create_TCP_Socket->TCP_Connect->(Sending HTML -> Tx_Start, Tx_SendByte->Tx_End).
Is this way is correct?
Please help me.
Kind regards

Mile

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Making a simple HTTP POST with EB-023

Post by LeighM »

line terminators should be \r\n not /r/n

rgds
Leigh

milea
Flowcode V4 User
Posts: 16
Joined: Fri Apr 24, 2009 11:56 am
Contact:

Re: Making a simple HTTP POST with EB-023

Post by milea »

Ok thanks, /r/n but actually I’m sending CRLF -> Chr(13)Chr(10) so that is not problem. I’m asking the all flow process for POSTing.
Kind regards
Mile

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Making a simple HTTP POST with EB-023

Post by LeighM »

Ah right, OK. Yes the flow looks OK. You will need to listen for a reply.
Are you connecting with your own local server? As you will need to setup the IP addresses accordingly. The TCP component won’t do the DNS lookup for you.

milea
Flowcode V4 User
Posts: 16
Joined: Fri Apr 24, 2009 11:56 am
Contact:

Re: Making a simple HTTP POST with EB-023

Post by milea »

I 'm conecting with remote web server, with fixed ip. Could you explained the whole process step by step ?
Kind regards
Mile

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Making a simple HTTP POST with EB-023

Post by LeighM »

using the TCP/IP component:

Initialize
Create_TCP_Socket
TCP_Connect
Send the request (Tx_start, Tx_sendbyte, Tx_end)
Loop waiting reply
{
Ready = Rx_data_available
Delay 500ms
If Ready <> 0 {Read the data (Rx_readbyte)}
}

milea
Flowcode V4 User
Posts: 16
Joined: Fri Apr 24, 2009 11:56 am
Contact:

Re: Making a simple HTTP POST with EB-023

Post by milea »

Thank you Leigh , it helps me.
Kind regards

Post Reply