This commit is contained in:
xuxueli 2018-03-13 19:30:58 +08:00
commit e2be31b2b7
1 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ public class HttpClientUtil {
/** /**
* post request * post request
*/ */
public static byte[] postRequest(String reqURL, byte[] date) throws Exception { public static byte[] postRequest(String reqURL, byte[] data) throws Exception {
byte[] responseBytes = null; byte[] responseBytes = null;
HttpPost httpPost = new HttpPost(reqURL); HttpPost httpPost = new HttpPost(reqURL);
@ -53,8 +53,8 @@ public class HttpClientUtil {
httpPost.setConfig(requestConfig); httpPost.setConfig(requestConfig);
// data // data
if (date != null) { if (data != null) {
httpPost.setEntity(new ByteArrayEntity(date, ContentType.DEFAULT_BINARY)); httpPost.setEntity(new ByteArrayEntity(data, ContentType.DEFAULT_BINARY));
} }
// do post // do post
HttpResponse response = httpClient.execute(httpPost); HttpResponse response = httpClient.execute(httpPost);