我正在尝试向服务器发送 Post 请求,但它正在向我发送数据错误。我想检查我发送的确切请求行。基本上我在做:
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(SERVER);
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("data1", data1));
nameValuePairs.add(new BasicNameValuePair("data2", data2));
....
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
(here I want to see my request, something like:
'data1=data1&data2=data2' http://[server.url] )
HttpResponse response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
谢谢您的回答