SimpleServer That Can Read POST from a Browser

Discussions related to the WiServer add-on code for WiShield. WiServer is a friendly, easy-to-use front end for webserver and webclient usages.

Moderator: shard7

SimpleServer That Can Read POST from a Browser

Postby slackerprime » Sat Apr 17, 2010 8:25 pm

I'm working on making a webserver application for the duemi using the wishield. I really like the simplicity of WiServer, so i want to use it. I have a webpage that has radio buttons on it. I have a submit button that should be clicked once the user has chosen the correct radio button. I can see using wireshark that the submit button is replaying with a proper POST command to the wishield. So i know that part of the code is working. BUT i don't see any way to make the arduino determine if it is a GET or a POST command that is coming in. I see the setReturnFun for the client side of wiserver. However, the arduino isn't POSTing to another server, a computer is POSTing to it. Is it possible to use WiServer to do this?

I can't figure out where or how WiServer is checking to confirm that the incoming transmission is a GET request. I was thinking that if i could find the GET check, i could either add an OR POST to the check.

Let me know if anyone knows the answer. I've been looking for similar questions, but it seems like most people are looking for ways of making the arduino POST to the world instead of accept POST commands.
slackerprime
 
Posts: 1
Joined: Mon Dec 21, 2009 10:34 pm

Re: SimpleServer That Can Read POST from a Browser

Postby GregEigsti » Sun Apr 18, 2010 8:37 am

Looks like the WiServer code "blindly" sends any and all received data to your data callback (e.g. provided in setReturnFunc); so it will be up to you to parse and figure out if the incoming data is a POST or GET (or something else).

Greg
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website


Return to WiServer

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest