HttpPost에 대해 2 개의 엔터티를 설정할 수 있습니까? 유사 :Gzip 및 NameValuePair가있는 Android HttpPost
HttpPost post = new HttpPost("http://www.abc.com");
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("A",
a));
nameValuePairs.add(new BasicNameValuePair("B", b));
post.setEntity(new UrlEncodedFormEntity(nameValuePairs, "UTF-8"));
post.setHeader("Accept-Encoding", "gzip");
ByteArrayEntity bae = new ByteArrayEntity(compress(json));
post.setEntity(bae);
HttpResponse resp;
resp = client.execute(post);
나는 매개 변수와 zip 파일이 있음을 서버에 알리려고합니다.
내 수정 된 링크 참조, 도움을 받으시 길 바랍니다. – amity
테스트 해 보겠습니다. 감사! – Maurice
링크는 약간의 조정만으로 필요한 것을 얻는 데 정말 유용했습니다. 감사합니다! – Maurice