HTTP Client

Discussion to talk about software related topics only.
Post Reply
mbinette
Posts: 4
Joined: Tue Sep 29, 2009 2:15 pm

HTTP Client

Post 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.
Ridgeglider
Posts: 513
Joined: Sat Apr 26, 2008 7:14 am

Re: HTTP Client

Post by Ridgeglider »

See:
C:\Nburn\docs\NetworkProgrammersGuide\NNDKProgMan.pdf cha[ters 8 and 9
also: C:\Nburn\examples\Web
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: HTTP Client

Post 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.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: HTTP Client

Post 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.
mbinette
Posts: 4
Joined: Tue Sep 29, 2009 2:15 pm

Re: HTTP Client

Post 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?
Ridgeglider
Posts: 513
Joined: Sat Apr 26, 2008 7:14 am

Re: HTTP Client

Post by Ridgeglider »

http://www.netburner.com/demonstration/ ... ation.html
Or at Netburner.com site, SUPPORT menu EXAMPLE APPLICATIONS
Post Reply