HTTP协议参数的传输格式

wudeaaa 2010-10-29 09:03:36
在HTTP中,参数如何传输,比如客户端给服务端POST Username="ABC",Id="122345",格式怎么样?服务端响应时也返回参数,
比如响应 ID="asdafasfas",Success=TRUE,格式如何?
...全文
403 点赞 收藏 10
写回复
10 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
wudeaaa 2010-10-29
如果实体包含ID="asdafasfas",Success=TRUE,这样行不行?

HTTP/1.1 200 OK
Date: Fri, 29 Oct 2010 01:05:51 GMT
Server: Apache
Last-Modified: Wed, 02 Dec 2009 08:00:00 GMT
ETag: "9f6"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Type: image/x-icon
Content-Length: 1341
Connection: close

ID=asdafasfas
Success=TRUE
回复
wudeaaa 2010-10-29
顶啦顶啦
回复
wudeaaa 2010-10-29
[Quote=引用 4 楼 jia20003 的回复:]
why you not take a close look at HTTP RFC document, it is official documentation from
IETF
[/Quote]我看了2617没有找着,可能是文字,没看出来,高人明示
回复
gloomyfish 2010-10-29
why you not take a close look at HTTP RFC document, it is official documentation from
IETF
回复
wudeaaa 2010-10-29
不是什么语言,只是请教HTTP发送这些参数的格式,与语言无关。从httpwatch上得到

POST /?login HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*
Referer: https://passport.baidu.com/?login&tpl=mn
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: passport.123.com
Content-Length: 230
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: PTOKEN=deleted; STOKEN=e0df9ee152affcb4f30dde02bd501a4a; BAIDUID=31145F69B4EBF1A438022B5F1A459F3F:FG=1; USERID=c069e92cb333ac8fc451f729a804; J_MY=1; BDUSS=EwUzIzUUUwY041NEJRUjBEWGltNndEWnpzNlNBYlctNkIwekh0djhCM3VxdkZNQUFBQUFBJCQAAAAAAAAAAAoaJhoAAAAAAAAAAAAAAAAAAAAADFHkIAAAAAAAQMlsEQAAAAAAAAAAChfzL-4dykzuHcpMb1

tpl_ok=&next_target=&tpl=mn&skip_ok=&aid=&need_pay=&need_coin=&pay_method=&u=http%3A%2F%2Fwww.baidu.com%2F&return_method=get&more_param=&return_type=&psp_tt=0&password=11111&safeflg=0&username=user&verifycode=&mem_pass=on

参数usename和password等以 password=11111&username=user的格式发送,假设服务端验证通过,响应的参数ID="asdafasfas",Success=TRUE,参数在实体中是怎么样发送的,例如响应头

HTTP/1.1 200 OK
Date: Fri, 29 Oct 2010 01:05:51 GMT
Server: Apache
Last-Modified: Wed, 02 Dec 2009 08:00:00 GMT
ETag: "9f6"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Type: image/x-icon
Content-Length: 1341
Connection: close

实体如何发送?
回复
dr_lou 2010-10-29
jsp有form
java有java.net.*
apache有HttpClient
回复
nicholasbobo 2010-10-29
你应该说清楚,你想用什么样的方式或语言来做
回复
wudeaaa 2010-10-29
Content-Type: text/xml
回复
paodan 2010-10-29
使用xml格式可以吗?
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2010-10-29 09:03
社区公告
暂无公告