Page 1 of 1
Making a simple HTTP POST with EB-023
Posted: Sun Mar 24, 2013 7:10 pm
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
Re: Making a simple HTTP POST with EB-023
Posted: Mon Mar 25, 2013 10:02 am
by LeighM
line terminators should be \r\n not /r/n
rgds
Leigh
Re: Making a simple HTTP POST with EB-023
Posted: Mon Mar 25, 2013 12:04 pm
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
Re: Making a simple HTTP POST with EB-023
Posted: Mon Mar 25, 2013 2:17 pm
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.
Re: Making a simple HTTP POST with EB-023
Posted: Thu Mar 28, 2013 8:15 pm
by milea
I 'm conecting with remote web server, with fixed ip. Could you explained the whole process step by step ?
Kind regards
Mile
Re: Making a simple HTTP POST with EB-023
Posted: Tue Apr 02, 2013 11:34 am
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)}
}
Re: Making a simple HTTP POST with EB-023
Posted: Sat Apr 20, 2013 6:38 pm
by milea
Thank you Leigh , it helps me.
Kind regards