Page 1 of 1

HTTP Client

Posted: Tue Sep 29, 2009 2:19 pm
by mbinette
I need to run an HTTP Client on the MOD5270 board. I see there is support for HTTP server processing and FTP server and client but I don't see an HTTP Client. Has anyone developed a simple library for doing an HTTP POST and HTTP GET from the NetBurner boards?

I noticed the TCP stuff makes it easy to open a port on a remote server but doesn't have any helper functions for sending GET and POST data.

Re: HTTP Client

Posted: Tue Sep 29, 2009 7:51 pm
by Ridgeglider
See:
C:\Nburn\docs\NetworkProgrammersGuide\NNDKProgMan.pdf cha[ters 8 and 9
also: C:\Nburn\examples\Web

Re: HTTP Client

Posted: Tue Sep 29, 2009 8:06 pm
by rnixon
What helper functions do you need? Once you have a TCP socket open to port 80, send GET\n\n (2 newlines) for index.htm, and specify the file for anything else. You can use wireshark to get packet captures using a web browser if you want to get it exactly identical. Just use a writestring() function. Just remember the server will terminate the tcp socket once the data has been sent.

Re: HTTP Client

Posted: Tue Sep 29, 2009 8:10 pm
by rnixon
I remembered an example of this. Check out the weather demo at http://www.netburner.com/demonstration/ ... ation.html. It gets data from a NOAA web server by doing a GET request.

Re: HTTP Client

Posted: Wed Sep 30, 2009 5:29 am
by mbinette
Thanks for the tips. I looked up the format of the HTTP GET and POST request/response text and it looks easy enough to handle using the writestring() method. Coming from a Java server based environment, I'm a little spoiled with all the higher level classes and functions.

Does anyone know where to download the Weather example? I looked in my nburn\examples directory and the Weather example doesn't exist. Every other one on that page does, just not the Weather one. Maybe it didn't come with the MOD5270 installer?

Re: HTTP Client

Posted: Wed Sep 30, 2009 7:43 am
by Ridgeglider
http://www.netburner.com/demonstration/ ... ation.html
Or at Netburner.com site, SUPPORT menu EXAMPLE APPLICATIONS