I'm trying to send a HTTP POST request to a Google server and get the response. I'm trying to send the exact same request that my browser would send. When I search, I checked the request and response from Chrome's developer tools. According to that, this is my request.
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"]
]
]
]
I used the Apache HTTP client to send the request but am only getting a page with that Google top bar. Please help me to do this.