0

我使用以下代码发送请求:

final DefaultHttpClient client = new DefaultHttpClient();
List<NameValuePair> pairs = new ArrayList<NameValuePair>();
pairs.add(new BasicNameValuePair("number", pNumber));
final HttpPost httpPost = new HttpPost(URL_MAIN);
httpPost.setEntity(new UrlEncodedFormEntity(pairs));
client.execute(httpPost);

它以 UTF-8 发送请求,但我需要 cp1251(站点仅适用于此 CP)。如何将其编码到cp1251中?

4

0 回答 0