httpclient 设置短连接_HTTP长连接、短连接使用及测试

## 客户端设置有效期为60s

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "POST /adx-api/api/creative/upload HTTP/1.1[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "Accept: application/json, application/*+json, text/html, application/json, text/javascript[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "Content-Type: application/json;charset=UTF-8[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.16 Safari/537.36[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "Accept-Language: zh-CN[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "Connection: keep-alive[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "Keep-Alive: timeout=60[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "Content-Length: 396[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "Host: bizdomain[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "request data"

##服务端设置有效期为5s

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 << "Date: Wed, 26 Apr 2017 06:07:58 GMT[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 << "Server: Apache-Coyote/1.1[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 << "Content-Type: text/html;charset=utf-8[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 << "Keep-Alive: timeout=5, max=100[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 << "Connection: Keep-Alive[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 << "Transfer-Encoding: chunked[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 << "[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 << "63[\r][\n]"

[2017-04-26 14:08:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 << "response data"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值