Jump to content

POST method format as REQUEST


overtaker

Recommended Posts

Hi currently im developing a C program using socket to send POST REQUEST to a http serveri tried to send:POST http://someurl HTTP/1.1HOST: hostnameContent-Type: applicationx-www-form-urlencodedContent-Length: 10name=kkkkkto the server which has<html><head></head><body>$name = $_REQUEST[name];if($name == NULL){ print('<Form action=info.php method=POST><input type="text" name="name"/><input type="submit"/></FORM>');}else{ print($name);}?></body></html>but I got these insteadHTTP/1.1 400 Bad RequestDate: Wed, 06 Sep 2006 15:47:06 GMTServer: Apache/1.3.34 (Unix) mod_perl/1.29Connection: closeTransfer-Encoding: chunkedContent-Type: text/html; charset=iso-8859-1126<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><HTML><HEAD><TITLE>400 Bad Request</TITLE></HEAD><BODY><H1>Bad Request</H1>Your browser sent a request that this server could not understand.<P>Request header field is missing colon separator.<P><PRE>name=kkkkk</PRE><P></BODY></HTML>what was wrong with my POST request ?note that if i did not incorporate content-length and the post content it works finethanks a lot for any help :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...