HTTP协议参数的传输格式

wudeaaa 2010-10-29 09:03:36
在HTTP中,参数如何传输,比如客户端给服务端POST Username="ABC",Id="122345",格式怎么样?服务端响应时也返回参数,
比如响应 ID="asdafasfas",Success=TRUE,格式如何?
...全文
548 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
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格式可以吗?

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧