Format of data portion of HTTP POST?
fogled@mizzou
Posts: 549
Sorry I'm having trouble finding a code example on this; I've got the rest of the HTTP connection stuff working, but I can't seem to find or figure out exactly how to format the data in the content portion of an HTTP POST call. Any help out there?
Thanks,
Thanks,
0
Comments
POST /path/script.cgi HTTP/1.0
From: frog@jmarshall.com
User-Agent: HTTPTool/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 32
home=Cosby&favorite+flavor=flies
Now I'm wondering if I need URLEncode or I can use text/plain encoding. The only thing I'm up against is spaces in some text being submitted.
You are correct...
//NOTE httpcontent = "'room=11&user=fogled&problem=this+problem+list'"
httpheader = "'POST /cobisapi.php HTTP/1.1',13,10";
httpheader = "httpheader,'Connection: close',13,10";
httpheader = "httpheader,'User-Agent: HTTPTool/1.0',13,10";
httpheader = "httpheader,'Host: localhost',13,10"
httpheader = "httpheader,'Content-Type: text/html',13,10";
httpheader = "httpheader,'Content-Length: ',ITOA(LENGTH_STRING(httpcontent)),13,10";
httpheader = "httpheader,13,10" // Extra Line Between Content
//then I'm sending the httpheader,httpcontent to the IP server.
The server just claims there's no POST data. Not sure what's up...