Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm new bie. I need send data to sever by post requet method. This is example POST:

POST /bin/login HTTP/1.1
Host: 127.0.0.1:8000
Accept: image/gif, image/jpeg,
Referer: http://127.0.0.1:8000/login.html
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Content-Length: 37
Connection: Keep-Alive
Cache-Control: no-cache

User=Peter+Lee&pw=123456&action=login

I read an example about http post method. I try.... but have some problems.

this is my problem:

when i use firefox to see "post request" but it does not like result of example. (about struct of request in firefox) It's only Graphic of firefox. I don't knonw have any "new line" between header and body in this picture. (sorry i can't upload picture to here!)

https://drive.google.com/file/d/0B7hpo_7GsGHtdzhhajRjbnNQNTQ/view?usp=sharing

Because i use a divice which send per line of headers and body to server. Thank you!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
264 views
Welcome To Ask or Share your Answers For Others

1 Answer

I think that's just the way Firefox displays the request headers, it separates the regular headers from the ones that describe the body content, even though they're not actually separate in the request. When I use the Web Developer tool, my display is slightly different from yours:

enter image description here

It shows the Content-Type and Content-Length headers in a section titled "Request headers from upload stream". Maybe you're using a different version of FF, or different developer tools (maybe you're using Firebug?).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...