【发布时间】:2011-09-25 03:08:18
【问题描述】:
我正在尝试向 Google 服务器发送 HTTP POST 请求并获得响应。我正在尝试发送与我的浏览器发送的完全相同的请求。当我搜索时,我检查了来自 Chrome 开发者工具的请求和响应。据此,这是我的要求。
Request URL:http://www.google.com/hotelfinder/rpc
Request Method:POST
Status Code:200 OK
request headers:
POST /hotelfinder/rpc HTTP/1.1
Host: www.google.com
Connection: keep-alive
Content-Length: 116
Origin: http://www.google.com
X-GWT-Module-Base: http://www.google.com/hotelfinder/static/
X-GWT-Permutation: A237247005BD7F571F547C07F4E1BA8D
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1
Content-Type: application/json; charset=UTF-8
Accept: */*
Referer: http://www.google.com/hotelfinder/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: rememberme=true; --my cookie--
payload:
[,[[,"hs","[,[,\"Las Vegas, NV\",\"2011-10-02\",1]\n]\n"]
]
,[,[[,"b_ca","101"]
,[,"b_qu","0"]
,[,"b_qc","1"]
]
]
]
我使用 Apache HTTP 客户端发送请求,但只获得了一个带有该 Google 顶栏的页面。请帮我这样做。
【问题讨论】:
标签: java html http networking