Ethernet demo : any /POST request sample please ?
Ethernet demo : any /POST request sample please ?
hi all,
i play with the Ethernet lib and would like to serve POST request.
all work as expected with GET request. i can serve my pages )
but i can't find a reliable solution to retrieve the body part of the POST request ...?
please any suggestions ? sample ?
any compiler, internal or external ..
thanks, regards
Phil
i play with the Ethernet lib and would like to serve POST request.
all work as expected with GET request. i can serve my pages )
but i can't find a reliable solution to retrieve the body part of the POST request ...?
please any suggestions ? sample ?
any compiler, internal or external ..
thanks, regards
Phil
- marina.petrovic
- Posts: 2986
- Joined: 18 Apr 2013 08:11
Re: Ethernet demo : any /POST request sample please ?
Hi,
Our Ethernet library is wrote to TCP/IP level, and POST request is implementation application level,
so because of that we didn't provided any example related with POST requests.
Please, take a look at this explanation:
http://www.w3schools.com/tags/ref_httpmethods.asp
Best regards,
Marina
Our Ethernet library is wrote to TCP/IP level, and POST request is implementation application level,
so because of that we didn't provided any example related with POST requests.
Please, take a look at this explanation:
http://www.w3schools.com/tags/ref_httpmethods.asp
Best regards,
Marina
Re: Ethernet demo : any /POST request sample please ?
Hi Marina,
thanks for your link, but I'm sorry I don't understand your answer !
the HTTP is an application protocol .. GET or POST are on same level !
so from your side view, with your library, I can't reply to POST request ?
thanks for your explanations, regards
Phil
thanks for your link, but I'm sorry I don't understand your answer !
the HTTP is an application protocol .. GET or POST are on same level !
so from your side view, with your library, I can't reply to POST request ?
thanks for your explanations, regards
Phil
Last edited by phil31 on 24 Jan 2014 00:42, edited 1 time in total.
Re: Ethernet demo : any /POST request sample please ?
oh thanks guy, I missed this link during my search !
I will check it now
regards
I will check it now
regards
Re: Ethernet demo : any /POST request sample please ?
in fact there is no /POST request sample in that thread, they only explain how POST request are send !
Marina, please can you explain a little more what is the problem with our libray please ?
and ==> "so from your side view, with your library, I can't reply to POST request ?"
thanks,
Phil
- marina.petrovic
- Posts: 2986
- Joined: 18 Apr 2013 08:11
Re: Ethernet demo : any /POST request sample please ?
Hi,
Sorry for misunderstanding, maybe I didn't expressed well in my previous post.
When I said that our Ethernet library is wrote to TCP/IP level, I thought that only simple examples are tested and provided
with the library and if you need POST request example, you will need to write it by yourself (application level).
I hoped that explanation that I send you can help and also the forum topic that aCkO posted.
Best regards,
Marina
Sorry for misunderstanding, maybe I didn't expressed well in my previous post.
When I said that our Ethernet library is wrote to TCP/IP level, I thought that only simple examples are tested and provided
with the library and if you need POST request example, you will need to write it by yourself (application level).
I hoped that explanation that I send you can help and also the forum topic that aCkO posted.
Best regards,
Marina
Re: Ethernet demo : any /POST request sample please ?
Well, I understand more your answer ! I already know that you provide only GET example.
anyway, the link provide by aCkO, don't help me : I already know how work a POST request and there is no example to show me how retrieve all lines from the request.
the easy way with GET sample, is that "all" important information, are immediately next after the /GET word ..and until the HTTP1.1\r\n\
Even if you don't provide POST sample, can you provide us enough information about how are managed the RX buffer and how the data are provided in this buffer to the users ?
when I try to catch "/POST" in that buffer (same as if we wait /GET), then I found it ! right..
but all data after that seem to be fragmented .. with a lot of irrelevant data between /POST and eventually "content-length" just before the beginning of the POST body..
I say eventually, because "content-length" is not ever find !!
thanks for you explanation
regards
anyway, the link provide by aCkO, don't help me : I already know how work a POST request and there is no example to show me how retrieve all lines from the request.
the easy way with GET sample, is that "all" important information, are immediately next after the /GET word ..and until the HTTP1.1\r\n\
Even if you don't provide POST sample, can you provide us enough information about how are managed the RX buffer and how the data are provided in this buffer to the users ?
when I try to catch "/POST" in that buffer (same as if we wait /GET), then I found it ! right..
but all data after that seem to be fragmented .. with a lot of irrelevant data between /POST and eventually "content-length" just before the beginning of the POST body..
I say eventually, because "content-length" is not ever find !!
thanks for you explanation
regards
Re: Ethernet demo : any /POST request sample please ?
POST data follows after the HTTP headers, the end of the headers is indicated by \r\n\r\n (A blank line)
The posted data then follows, each data item is prefixed with the name of the field the data corresponds to followed by an '=' character, the data may then be URL encoded.
Multiple data items are delimited by the '&' character.
The posted data then follows, each data item is prefixed with the name of the field the data corresponds to followed by an '=' character, the data may then be URL encoded.
Multiple data items are delimited by the '&' character.
Kind Regards,
Sy
Sy
Re: Ethernet demo : any /POST request sample please ?
Hi,
Recon you need to power up Wireshark & capture the transactions.
when doing simple GET , the actual request will most likely fit inside one packet.
You don't get to see the SYN/FIN housekeeping.
A POST however , will most likely be broken into multiple packets that need to be managed .
perhaps you need to look at using the STACK version of the ethernet Lib.
Either way , Wireshark will enlighten you ! .
Recon you need to power up Wireshark & capture the transactions.
when doing simple GET , the actual request will most likely fit inside one packet.
You don't get to see the SYN/FIN housekeeping.
A POST however , will most likely be broken into multiple packets that need to be managed .
perhaps you need to look at using the STACK version of the ethernet Lib.
Either way , Wireshark will enlighten you ! .
Re: Ethernet demo : any /POST request sample please ?
hi BarryP
yes you surely point to the right answer ..
the POST request is broken in multiple packet
what do you mean by
"perhaps you need to look at using the STACK version of the ethernet Lib."
what/where is the STACK version ?
thanks for your advice
regards
yes you surely point to the right answer ..
the POST request is broken in multiple packet
what do you mean by
"perhaps you need to look at using the STACK version of the ethernet Lib."
what/where is the STACK version ?
thanks for your advice
regards
Re: Ethernet demo : any /POST request sample please ?
Hi,
I don't have any real world experience using it , but it's in the Libstock .
http://www.libstock.com/projects/view/1 ... et-library
I don't have any real world experience using it , but it's in the Libstock .
http://www.libstock.com/projects/view/1 ... et-library
Re: Ethernet demo : any /POST request sample please ?
Maybe I've misunderstood, but I thought what was being asked for was a way to interpret the HTTP data on the server once it had been posted ?
If this is the case then the data will not be chunked, it will be in one contiguous data stream that can be interpreted by the code.
If you what you are asking for is how to interpret the response then the response 'may' be chunked, but this is the same for delivery of any large data including pages.
But since you have asked specifically about the PIC code, I think what you are asking for is the server side, in which case forget about multi-part packets (chunks), and focus on the data stream.
If this is the case then the data will not be chunked, it will be in one contiguous data stream that can be interpreted by the code.
If you what you are asking for is how to interpret the response then the response 'may' be chunked, but this is the same for delivery of any large data including pages.
But since you have asked specifically about the PIC code, I think what you are asking for is the server side, in which case forget about multi-part packets (chunks), and focus on the data stream.
Kind Regards,
Sy
Sy
Re: Ethernet demo : any /POST request sample please ?
hi BarryP and Sy
well you make me confuse now .. my problem Is right on the server side, with the ME Ethernet library.
my problem is more like suggest BarryP : the data I retrieve, when I do a POST request (on the client, a button do a POST request instead a GET), I can catch the first packet with the line "/POST .... \r\n" ..
but in the same packet, I don't find the next of the request : the header end, then the body part of the request.
I need to wait a lot of call to "Net_Ethernet_Intern_UserTCP" before find only some part of the header/body request and the parts are mixed .. !
as we don't know (or I forget some function?), we don't know the size of the RX buffer message. it's is hard to define a start and a end inside the RX buffer and keep only the request message.
I open a ticket to ME team, to know how work the RX buffer. but for now, no reply ..
BarryP ==> you mean to manage the "socket^.state", to know when I can keep data from RX buffer or not ?
then reconstruct the full request ?
thanks guys, have a nice day
well you make me confuse now .. my problem Is right on the server side, with the ME Ethernet library.
my problem is more like suggest BarryP : the data I retrieve, when I do a POST request (on the client, a button do a POST request instead a GET), I can catch the first packet with the line "/POST .... \r\n" ..
but in the same packet, I don't find the next of the request : the header end, then the body part of the request.
I need to wait a lot of call to "Net_Ethernet_Intern_UserTCP" before find only some part of the header/body request and the parts are mixed .. !
as we don't know (or I forget some function?), we don't know the size of the RX buffer message. it's is hard to define a start and a end inside the RX buffer and keep only the request message.
I open a ticket to ME team, to know how work the RX buffer. but for now, no reply ..
BarryP ==> you mean to manage the "socket^.state", to know when I can keep data from RX buffer or not ?
then reconstruct the full request ?
thanks guys, have a nice day
- marina.petrovic
- Posts: 2986
- Joined: 18 Apr 2013 08:11
Re: Ethernet demo : any /POST request sample please ?
Hi,
I believe that I answered you on this question via support desk so we continue our correspondence there.
Best regards,
Marina
I believe that I answered you on this question via support desk so we continue our correspondence there.
Best regards,
Marina