0%
POST
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| String result = HttpRequest.post(AEP_GATE_URL.concat(url)) .header(AEP_NONCE,uuid) .header(AEP_APPKEY,appKeyValue) .header(AEP_TIMESTAMP,timestamp) .header(AEP_SIGNATURE,hmac256Encode(getBody(uuid, timestamp))) .body(MapUtil.sortJoin(fromcs, "&", "=",true)) .timeout(20000)
.setHttpProxy("127.0.0.1", 8888) .execute().body();
|
指定编码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| String result = HttpRequest.post(AEP_GATE_URL.concat(url)) .header(AEP_NONCE,uuid) .header(AEP_APPKEY,appKeyValue) .header(AEP_TIMESTAMP,timestamp) .header(AEP_SIGNATURE,hmac256Encode(getBody(uuid, timestamp))) .contentType("application/x-www-form-urlencoded;charset=GBK") .form(fromcs) .timeout(20000)
.setHttpProxy("127.0.0.1", 8888) .execute().body();
|
1 2 3 4
| String result2= HttpUtil.get(phone.getUrl(),CharsetUtil.CHARSET_GBK); //发送http请求 String rsp = HttpRequest.post(url).contentType("application/x-www-form-urlencoded;charset=GBK").charset("GBK") .form(map).execute().body();
|