log request and response for http
[main] INFO com.github.gobars.rest.Rest - GET http://127.0.0.1:9333/dir/assign, code:200
RestTest.DirAssign(count=1, fid=3,13807be42d, publicUrl=localhost:8080)
[main] INFO com.github.gobars.rest.Rest - POST http://localhost:8080/3,13807be42d, code:201
RestTest.UploadResult(name=biniki.png, size=440085, eTag=ebb52112)
[main] INFO com.github.gobars.rest.Rest - GET http://localhost:8080/3,13807be42d, code:200
null
[main] INFO com.github.gobars.rest.Rest - HEAD http://localhost:8080/3,13807be42d, code:200
{Accept-Ranges=bytes, Etag="ebb52112", Content-Disposition=inline; filename="biniki.png", Last-Modified=Thu, 10 Sep 2020 11:26:03 GMT, Content-Length=440085, Date=Thu, 10 Sep 2020 11:26:03 GMT, Content-Type=image/png}
[main] INFO com.github.gobars.rest.Rest - POST http://127.0.0.1:8812, code:200
POST / HTTP/1.1
Host: 127.0.0.1:8812
Accept-Encoding: gzip,deflate
Connection: Keep-Alive
Content-Length: 61
Content-Type: application/json; charset=UTF-8
User-Agent: Apache-HttpClient/4.5.12 (Java/11.0.8)
{"count":1,"fid":"3,13807be42d","publicUrl":"localhost:8080"}- env
REST_MAX_CONN_TOTAL设置 连接池总大小,默认值 100。设置方法: 使用java -DREST_MAX_CONN_TOTAL=100或者 启动前设置 shell 环境变量export REST_MAX_CONN_TOTAL=100 - env
REST_MAX_CONN_PER_ROUTE设置 单个主机路由总大小,默认值 100。设置方法同上。 - 代理
- 全局代理:env
REST_PROXY设置代理,示例值http://localhost:8080。使用java -DREST_PROXY=http://www.proxy.com:8080或者 启动前设置 shell 环境变量export REST_PROXY=http://www.proxy.com:8080 - 全局代理(Basic 认证):env
REST_PROXY设置代理,示例值http://localhost:8080。使用java -DREST_PROXY=http://user:[email protected]:8080或者 启动前设置 shell 环境变量export REST_PROXY=http://user:[email protected]:8080 - 请求代理:
new Rest().exec(new RestOption().proxy("http://www.proxy.com:8080").url("http://127.0.0.1:8080/status")); - 请求代理(Basic 认证):
new Rest().exec(new RestOption().proxy("http://user:[email protected]:8080").url("http://127.0.0.1:8080/status")); - 请求不走全局代理:
new Rest().exec(new RestOption().disableGlobalProxy().url("http://127.0.0.1:8080/status"));
- 全局代理:env