UTF
エンコーディングをHttp Post
リクエストに設定するにはどうすればよいですか?
これが私のコードスニペットです。
HttpClient httpClient = getNewHttpClient();
String user_agent = (String) httpClient.getParams().getParameter(
CoreProtocolPNames.USER_AGENT)
+ " Android";
httpClient.getParams().setParameter(CoreProtocolPNames.USER_AGENT,
user_agent);
httpClient.getParams().setBooleanParameter(
"http.protocol.expect-continue", false);
HttpResponse response;
HttpPost post = new HttpPost(remoteUrl);
System.out.println("Url:" + remoteUrl + " values:"
+ nameValuePair.toString());
post.setEntity(new UrlEncodedFormEntity(nameValuePair));
response = httpClient.execute(post);
int postStatus = response.getStatusLine().getStatusCode();
String result = EntityUtils.toString(response.getEntity());
System.out.println("result:" + result);