public static SimpleWebResponse SimpleHttpPost(AndroidHttpClient client, String url, String body, String contentType, String callerDebugName) throws IOException {
String netResult = "", line;
HttpPost postRequest = new HttpPost(url);
postRequest.addHeader("accept", contentType);
postRequest.setEntity(new StringEntity(body, "UTF8"));
HttpResponse response = client.execute(postRequest);
if (response.getStatusLine().getStatusCode() != 200) {
HttpResponseLog(response, callerDebugName);
return new SimpleWebResponse(null, false);
}else{
BufferedReader br = new BufferedReader(
new InputStreamReader((response.getEntity().getContent())));
while ((line = br.readLine()) != null) {
netResult = netResult + line;
}
}
return new SimpleWebResponse(netResult, true);
}
WebUtil.java 文件源码
java
阅读 36
收藏 0
点赞 0
评论 0
项目:BitcoinCardTerminal
作者:
评论列表
文章目录