http post请求与firefox和示例的区别 [英] http post request difference from firefox and example
问题描述
我是新人。
我需要通过post requet方法将数据发送到服务器。
这是示例POST:
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
我读了一个关于http post方法的例子。我尝试....但有一些问题。
I read an example about http post method. I try.... but have some problems.
这是我的问题:
当我使用firefox查看发布请求但它不喜欢例子的结果。
(关于firefox中的请求结构)它只是firefox的图形。我不知道在这张照片中标题和正文之间有任何新行。
(对不起,我无法将图片上传到这里!)
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!
推荐答案
我认为这就是Firefox显示请求标头的方式,它将常规标头与描述身体内容的那些,即使它们在请求中实际上没有分开。当我使用Web Developer工具时,我的显示与您的显示略有不同:
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:
它显示 Content-Type
和 Content-Length
标题为
从上传流请求标头的部分中的标题。也许您正在使用不同版本的FF或不同的开发人员工具(也许您正在使用Firebug?)。
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?).
这篇关于http post请求与firefox和示例的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!