RestTemplate的一个请求过程,mark一下

17:14:36.979 [main] DEBUG org.springframework.web.client.RestTemplate - Created GET request for "http://localhost:8080/test/session/get"
17:14:36.992 [main] DEBUG org.springframework.web.client.RestTemplate - Setting request Accept header to [application/json, application/*+json]
17:14:37.007 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: default
17:14:37.015 [main] DEBUG org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context
17:14:37.016 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection request: [route: {}->http://localhost:8080][total kept alive: 0; route allocated: 0 of 200; total allocated: 0 of 300]
17:14:37.028 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection leased: [id: 0][route: {}->http://localhost:8080][total kept alive: 0; route allocated: 1 of 200; total allocated: 1 of 300]
17:14:37.030 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Opening connection {}->http://localhost:8080
17:14:37.037 [main] DEBUG org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connecting to localhost/127.0.0.1:8080
17:14:37.038 [main] DEBUG org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connection established 127.0.0.1:60552<->127.0.0.1:8080
17:14:37.038 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-0: set socket timeout to 5000
17:14:37.038 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Executing request GET /test/session/get HTTP/1.1
17:14:37.038 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Target auth state: UNCHALLENGED
17:14:37.038 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Proxy auth state: UNCHALLENGED
17:14:37.040 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> GET /test/session/get HTTP/1.1
17:14:37.040 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept: application/json, application/*+json
17:14:37.040 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Type: application/json;charset=UTF-8
17:14:37.040 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Host: localhost:8080
17:14:37.040 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
17:14:37.040 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5.6 (Java/1.8.0_144)
17:14:37.040 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
17:14:37.040 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "GET /test/session/get HTTP/1.1[\r][\n]"
17:14:37.040 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept: application/json, application/*+json[\r][\n]"
17:14:37.040 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Type: application/json;charset=UTF-8[\r][\n]"
17:14:37.040 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Host: localhost:8080[\r][\n]"
17:14:37.040 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
17:14:37.040 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.5.6 (Java/1.8.0_144)[\r][\n]"
17:14:37.040 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
17:14:37.040 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
17:14:37.056 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 200 [\r][\n]"
17:14:37.056 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "X-Application-Context: application:dev,redis,log,flyway[\r][\n]"
17:14:37.056 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "ETag: "099914b932bd37a50b983c5e7c90ae93b"[\r][\n]"
17:14:37.056 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "X-Content-Type-Options: nosniff[\r][\n]"
17:14:37.056 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "X-XSS-Protection: 1; mode=block[\r][\n]"
17:14:37.056 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "X-Frame-Options: DENY[\r][\n]"
17:14:37.056 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Set-Cookie: SESSION=36fed5e6-fe6d-4b9e-87a1-7f7aa5ef8bf0; Path=/; HttpOnly[\r][\n]"
17:14:37.056 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Type: application/json[\r][\n]"
17:14:37.056 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Content-Length: 2[\r][\n]"
17:14:37.056 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "Date: Thu, 13 Dec 2018 09:14:37 GMT[\r][\n]"
17:14:37.056 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
17:14:37.056 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "{}"
17:14:37.058 [main] DEBUG org.apache.http.headers - http-outgoing-0 << HTTP/1.1 200
17:14:37.058 [main] DEBUG org.apache.http.headers - http-outgoing-0 << X-Application-Context: application:dev,redis,log,flyway
17:14:37.058 [main] DEBUG org.apache.http.headers - http-outgoing-0 << ETag: "099914b932bd37a50b983c5e7c90ae93b"
17:14:37.058 [main] DEBUG org.apache.http.headers - http-outgoing-0 << X-Content-Type-Options: nosniff
17:14:37.058 [main] DEBUG org.apache.http.headers - http-outgoing-0 << X-XSS-Protection: 1; mode=block
17:14:37.058 [main] DEBUG org.apache.http.headers - http-outgoing-0 << X-Frame-Options: DENY
17:14:37.058 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Set-Cookie: SESSION=36fed5e6-fe6d-4b9e-87a1-7f7aa5ef8bf0; Path=/; HttpOnly
17:14:37.058 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Type: application/json
17:14:37.058 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Length: 2
17:14:37.058 [main] DEBUG org.apache.http.headers - http-outgoing-0 << Date: Thu, 13 Dec 2018 09:14:37 GMT
17:14:37.061 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection can be kept alive indefinitely
17:14:37.066 [main] DEBUG org.apache.http.client.protocol.ResponseProcessCookies - Cookie accepted [SESSION="36fed5e6-fe6d-4b9e-87a1-7f7aa5ef8bf0", version:0, domain:localhost, path:/, expiry:null]
17:14:37.070 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection [id: 0][route: {}->http://localhost:8080] can be kept alive indefinitely
17:14:37.070 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-0: set socket timeout to 0
17:14:37.070 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection released: [id: 0][route: {}->http://localhost:8080][total kept alive: 1; route allocated: 1 of 200; total allocated: 1 of 300]
17:14:37.070 [main] INFO com.tangcheng.app.business.config.LoggingClientHttpRequestInterceptor - cost:[74]ms,GET url:http://localhost:8080/test/session/get. request:,
response:{},
17:14:37.072 [main] DEBUG org.springframework.web.client.RestTemplate - GET request for "http://localhost:8080/test/session/get" resulted in 200 ()
17:14:37.073 [main] DEBUG org.springframework.web.client.RestTemplate - Reading [java.util.Map<java.lang.String, java.lang.Object>] as "application/json" using [org.springfr[email protected]2dca0d64]
{}
17:14:37.098 [main] DEBUG org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate - Retrieved ApplicationContext from cache with key [[[email protected] testClass = RestTemplateApiTest, locations = ‘{}‘, classes = ‘{class com.tangcheng.app.business.config.RestTemplateConfig}‘, contextInitializerClasses = ‘[]‘, activeProfiles = ‘{}‘, propertySourceLocations = ‘{}‘, propertySourceProperties = ‘{}‘, contextCustomizers = set[org.springfr[email protected]6321e813, org.springframework.boot.test.json.DuplicateJsonObje[email protected]57855c9a, org.[email protected]0, org.springframework.boot[email protected]0, org.springframework.boot.test.autocon[email protected]5f282abb], contextLoader = ‘org.springframework.test.context.support.DelegatingSmartContextLoader‘, parent = [null]]]
17:14:37.098 [main] DEBUG org.springframework.test.context.cache - Spring test ApplicationContext cache statistics: [[email protected] size = 1, maxSize = 32, parentContextCount = 0, hitCount = 2, missCount = 1]
17:14:37.098 [main] DEBUG org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate - Retrieved ApplicationContext from cache with key [[[email protected] testClass = RestTemplateApiTest, locations = ‘{}‘, classes = ‘{class com.tangcheng.app.business.config.RestTemplateConfig}‘, contextInitializerClasses = ‘[]‘, activeProfiles = ‘{}‘, propertySourceLocations = ‘{}‘, propertySourceProperties = ‘{}‘, contextCustomizers = set[org.springfr[email protected]6321e813, org.springframework.boot.test.json.DuplicateJsonObje[email protected]57855c9a, org.[email protected]0, org.springframework.boot[email protected]0, org.springframework.boot.test.autocon[email protected]5f282abb], contextLoader = ‘org.springframework.test.context.support.DelegatingSmartContextLoader‘, parent = [null]]]
17:14:37.098 [main] DEBUG org.springframework.test.context.cache - Spring test ApplicationContext cache statistics: [[email protected] size = 1, maxSize = 32, parentContextCount = 0, hitCount = 3, missCount = 1]
17:14:37.099 [main] DEBUG org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate - Retrieved ApplicationContext from cache with key [[[email protected] testClass = RestTemplateApiTest, locations = ‘{}‘, classes = ‘{class com.tangcheng.app.business.config.RestTemplateConfig}‘, contextInitializerClasses = ‘[]‘, activeProfiles = ‘{}‘, propertySourceLocations = ‘{}‘, propertySourceProperties = ‘{}‘, contextCustomizers = set[org.springfr[email protected]6321e813, org.springframework.boot.test.json.DuplicateJsonObje[email protected]57855c9a, org.[email protected]0, org.springframework.boot[email protected]0, org.springframework.boot.test.autocon[email protected]5f282abb], contextLoader = ‘org.springframework.test.context.support.DelegatingSmartContextLoader‘, parent = [null]]]
17:14:37.100 [main] DEBUG org.springframework.test.context.cache - Spring test ApplicationContext cache statistics: [[email protected] size = 1, maxSize = 32, parentContextCount = 0, hitCount = 4, missCount = 1]
17:14:37.100 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean ‘org.springframework.boot.test.mock.mockito.MockitoBeans‘
17:14:37.100 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - After test method: context [[email protected] testClass = RestTemplateApiTest, testInstance = [email protected], testMethod = [email protected]t, testException = [null], mergedContextConfiguration = [[email protected] testClass = RestTemplateApiTest, locations = ‘{}‘, classes = ‘{class com.tangcheng.app.business.config.RestTemplateConfig}‘, contextInitializerClasses = ‘[]‘, activeProfiles = ‘{}‘, propertySourceLocations = ‘{}‘, propertySourceProperties = ‘{}‘, contextCustomizers = set[org.springfr[email protected]6321e813, org.springframework.boot.test.json.DuplicateJsonObje[email protected]57855c9a, org.[email protected]0, org.springframework.boot[email protected]0, org.springframework.boot.test.autocon[email protected]5f282abb], contextLoader = ‘org.springframework.test.context.support.DelegatingSmartContextLoader‘, parent = [null]]], class annotated with @DirtiesContext [false] with mode [null], method annotated with @DirtiesContext [false] with mode [null].
17:14:37.105 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - After test class: context [[email protected] testClass = RestTemplateApiTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [[email protected] testClass = RestTemplateApiTest, locations = ‘{}‘, classes = ‘{class com.tangcheng.app.business.config.RestTemplateConfig}‘, contextInitializerClasses = ‘[]‘, activeProfiles = ‘{}‘, propertySourceLocations = ‘{}‘, propertySourceProperties = ‘{}‘, contextCustomizers = set[org.springfr[email protected]6321e813, org.springframework.boot.test.json.DuplicateJsonObje[email protected]57855c9a, org.[email protected]0, org.springframework.boot[email protected]0, org.springframework.boot.test.autocon[email protected]5f282abb], contextLoader = ‘org.springframework.test.context.support.DelegatingSmartContextLoader‘, parent = [null]]], class annotated with @DirtiesContext [false] with mode [null].
17:14:37.106 [Thread-0] INFO com.tangcheng.app.business.config.RestTemplateConfig - closing http client
17:14:37.106 [Thread-1] INFO org.springframework.context.support.GenericApplicationContext - Closing [email protected]0f8e03: startup date [Thu Dec 13 17:14:35 CST 2018]; root of context hierarchy
17:14:37.106 [Thread-0] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection manager is shutting down
17:14:37.106 [Thread-0] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-0: Close connection
17:14:37.106 [Thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean ‘lifecycleProcessor‘
17:14:37.106 [Thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.s[email protected]143640d5: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,restTemplateConfig,org.springframework.boot.test.mock.mockito.MockitoPostProcessor$SpyPostProcessor,org.springframework.boot.test.mock.mockito.MockitoPostProcessor,restTemplate]; root of factory hierarchy
17:14:37.107 [Thread-0] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection manager shut down
17:14:37.107 [Thread-0] INFO com.tangcheng.app.business.config.RestTemplateConfig - http client closed

感觉挺有意思的

原文地址:https://www.cnblogs.com/softidea/p/10115215.html

时间: 2024-10-13 07:38:23

RestTemplate的一个请求过程,mark一下的相关文章

浏览器一个请求过程

整个流程如下: 域名解析 为了将消息从你的PC上传到服务器 上.需要用到1P协议.ARP协议和0SPF协议 发起TCP的3次握手 建立TCP连接后发起http请求 服务器响应htp请求 浏览器解析htm代码,并请求html代码中的资源(如js.css.图片等) 断开TCP连接 浏览器对页面进行渲染呈现给用户 一.域名解析的详细内部过程 例如,要查询www.baidu.com的IP地址(DNS解析url): 浏览器搜索自己的DNS缓存(维护一张域名与IP地址的对应表) 若没有,则搜索操作系统中的D

Django处理一个请求的过程

一.Django处理一个请求的过程 Django处理一个请求的过程如下: Django使用的是根URLconif模块,这个值通常通过ROOT_URLCONF设置:url到视图函数的映射关系(在.../settings.py文件中) Django加载URLconf模块(urls.py),并寻找可用的urlpatterns,匹配规则参考二 Django依次匹配每个URL模式,在与请求的URL匹配的第一个模式处停下来 一旦其中一个正则表达式匹配上,则Django将请求指向对应的视图函数处理 如果没有匹

一个完整的HTTP请求过程详细

整个流程1.域名解析 —> 2.与服务器建立连接 —> 3.发起HTTP请求 —>4. 服务器响应HTTP请求,浏览器得到html代码 —> 5.浏览器解析html代码,并请求html代码中的资源(如js.css.图片) —> 6.浏览器对页面进行渲染呈现给用户 1. 域名解析 以Chrome浏览器为例: ① Chrome浏览器 会首先搜索浏览器自身的DNS缓存(缓存时间比较短,大概只有1分钟,且只能容纳1000条缓存),看自身的缓存中是否有https://www.cnblo

springMVC的请求过程

springMVC请求过程: 请求信息(包括用户相关信息)发送到DispatcherServlet,DispatcherServlet在这里做为前端控制器. DispatcherServlet查询处理器映射,处理器映射会根据请求携带的URL信息进行决策. 当选择了合适的控制器,DispatcherServlet会将请求发送给选中的控制器.在这里控制器会处理这些信息. 控制器在完成逻辑处理后,会产生一些信息,这些信息将被打包成模型(model),并指定一个接收视图名(逻辑名). Dispatche

mvc请求过程总结-前篇

前言 最近在思考一个问题,我的学习方法一般主要是看博客来学习新东西,但是光看,基本也没总结过,所以经常会出现这样的问题,某个知识点我知道,但是就是不能很好的表达出来,很简单的东西往往都不知道如何简短精炼的阐述清楚.所以我想到应该每天抑或是经常性的总结近期学到的知识,这样既可以巩固知识又可以提高语言的组织能力. MVC的请求过程 有些比较细节的地方直接忽略了,我主要摸索它的大概轨迹 首先从客户端发出请求开始,iis接受请求,找到web应用程序运行的工作者进程,如果进程不存在,则创建的新的工作进程,

深入Web请求过程(笔记)

深入Web请求过程 B/.S架构的好处: B/S架构带来两方面好处: l  客服端使用统一浏览器,由于浏览器具有统一性,有效屏蔽了不同服务提供商提供给用户使用服务的差异性.. l  服务端基于统一的HTTP,为服务提供商简化了开发模式,节省开发成本,服务开发者只需要关注提供服务的应用逻辑. B/S网络架构概述 B/S网络架构从前端到后端都是基于统一的应用层协议HTTP来交互数据,与传统C/S架构采用的长连接的交互模式不同,HTTP采用无状态的短连接的通信方式.通常情况下,一次请求就完成一次数据交

ASP.NET 运行时详解 揭开请求过程神秘面纱

对于ASP.NET开发,排在前五的话题离不开请求生命周期.像什么Cache.身份认证.Role管理.Routing映射,微软到底在请求过程中干了哪些隐秘的事,现在是时候揭晓了.抛开乌云见晴天,接下来就一步步揭开请求管道神秘面纱. 上篇回顾 在介绍本篇内容之前,让我们先回顾下上一篇<ASP.NET运行时详解 集成模式和经典模式>的主要内容.在上一篇随笔中,我们提到ASP.NET运行时通过Application的InitInternal方法初始化运行管道.ASP.NET运行时提供了两种初始化管道模

超文本传输协议,http请求过程

超文本传输协议. 2.http请求过程. { 1> http协议: 超文本传输协议(Hypertext Transfer Protocol) { http协议规定了客户端和服务器之间的数据传输格式. http协议是在网络开发中最常用的协议.不管是移动客户端还是PC端,访问网络资源经常使用http协议. http优点: <1> 简单快速: http协议简单,通信速度很快. <2> 灵活: http协议允许传输任意类型的数据. <3> http协议是短连接(非持续性连

一个请求在Struts2框架中的处理流程

1.客户端向Servlet容器发起一个请求,将请求封装为HttpServletRequest对象. 2.HttpServletRequest首先经过web.xml中配置的struts2的过滤器,以及struts2内置的一些过滤器. 3.接着FilterDispatcher(现已过时)被调用,FilterDispatcher询问ActionMapper来决定这个请是否需要调用某个Action. 4.如果ActionMapper决定需要调用某个Action,FilterDispatcher把请求的处