接口的使用
org.springframework.http.client.ClientHttpRequest
使用ClientHttpRequest的程序包 程序包 说明 org.springframework.http.client Contains an abstraction over client-side HTTP.org.springframework.http.client.support This package provides generic HTTP support classes, to be used by higher-level classes like RestTemplate.org.springframework.mock.http.client Mock implementations of client-side HTTP abstractions.org.springframework.test.web.client Contains client-side REST testing support.org.springframework.test.web.client.response Contains built-inResponseCreatorimplementations.org.springframework.web.client Core package of the client-side web support.org.springframework.http.client中ClientHttpRequest的使用
实现ClientHttpRequest的org.springframework.http.client中的类 修饰符和类型 类 说明 classAbstractClientHttpRequestAbstract base forClientHttpRequestthat makes sure that headers and body are not written multiple times.返回ClientHttpRequest的org.springframework.http.client中的方法 修饰符和类型 方法 说明 ClientHttpRequestAbstractClientHttpRequestFactoryWrapper. createRequest(URI uri, HttpMethod httpMethod)This implementation simply callsAbstractClientHttpRequestFactoryWrapper.createRequest(URI, HttpMethod, ClientHttpRequestFactory)with the wrapped request factory provided to the constructor.protected abstract ClientHttpRequestAbstractClientHttpRequestFactoryWrapper. createRequest(URI uri, HttpMethod httpMethod, ClientHttpRequestFactory requestFactory)Create a newClientHttpRequestfor the specified URI and HTTP method by using the passed-on request factory.protected ClientHttpRequestBufferingClientHttpRequestFactory. createRequest(URI uri, HttpMethod httpMethod, ClientHttpRequestFactory requestFactory)ClientHttpRequestClientHttpRequestFactory. createRequest(URI uri, HttpMethod httpMethod)Create a newClientHttpRequestfor the specified URI and HTTP method.ClientHttpRequestHttpComponentsClientHttpRequestFactory. createRequest(URI uri, HttpMethod httpMethod)protected ClientHttpRequestInterceptingClientHttpRequestFactory. createRequest(URI uri, HttpMethod httpMethod, ClientHttpRequestFactory requestFactory)ClientHttpRequestNetty4ClientHttpRequestFactory. createRequest(URI uri, HttpMethod httpMethod)已过时。ClientHttpRequestOkHttp3ClientHttpRequestFactory. createRequest(URI uri, HttpMethod httpMethod)ClientHttpRequestSimpleClientHttpRequestFactory. createRequest(URI uri, HttpMethod httpMethod)参数类型为ClientHttpRequest的org.springframework.http.client中的方法 修饰符和类型 方法 说明 voidClientHttpRequestInitializer. initialize(ClientHttpRequest request)Initialize the given client HTTP request.org.springframework.http.client.support中ClientHttpRequest的使用
返回ClientHttpRequest的org.springframework.http.client.support中的方法 修饰符和类型 方法 说明 protected ClientHttpRequestHttpAccessor. createRequest(URI url, HttpMethod method)Create a newClientHttpRequestvia this template'sClientHttpRequestFactory.org.springframework.mock.http.client中ClientHttpRequest的使用
实现ClientHttpRequest的org.springframework.mock.http.client中的类 修饰符和类型 类 说明 classMockAsyncClientHttpRequest已过时。as of Spring 5.0, with no direct replacementclassMockClientHttpRequestMock implementation ofClientHttpRequest.org.springframework.test.web.client中ClientHttpRequest的使用
返回ClientHttpRequest的org.springframework.test.web.client中的方法 修饰符和类型 方法 说明 ClientHttpRequestMockMvcClientHttpRequestFactory. createRequest(URI uri, HttpMethod httpMethod)返回变量类型为ClientHttpRequest的类型的org.springframework.test.web.client中的方法 修饰符和类型 方法 说明 protected List<ClientHttpRequest>AbstractRequestExpectationManager. getRequests()Return a read-only list of requests executed so far.参数类型为ClientHttpRequest的org.springframework.test.web.client中的方法 修饰符和类型 方法 说明 ClientHttpResponseDefaultRequestExpectation. createResponse(ClientHttpRequest request)Note that as of 5.0.3, the creation of the response, which may block intentionally, is separated from request count tracking, and this method no longer increments the count transparently.ClientHttpResponseResponseCreator. createResponse(ClientHttpRequest request)Create a response for the given request.protected AssertionErrorAbstractRequestExpectationManager. createUnexpectedRequestError(ClientHttpRequest request)Return anAssertionErrorthat a sub-class can raise for an unexpected request.RequestExpectationAbstractRequestExpectationManager.RequestExpectationGroup. findExpectation(ClientHttpRequest request)Return a matching expectation, ornullif none match.voidDefaultRequestExpectation. match(ClientHttpRequest request)voidRequestMatcher. match(ClientHttpRequest request)Match the given request against specific expectations.protected RequestExpectationAbstractRequestExpectationManager. matchRequest(ClientHttpRequest request)As of 5.0.3 subclasses should implement this method instead ofAbstractRequestExpectationManager.validateRequestInternal(ClientHttpRequest)in order to match the request to an expectation, leaving the call to create the response as a separate step (to be invoked by this class).protected RequestExpectationSimpleRequestExpectationManager. matchRequest(ClientHttpRequest request)RequestExpectationUnorderedRequestExpectationManager. matchRequest(ClientHttpRequest request)ClientHttpResponseAbstractRequestExpectationManager. validateRequest(ClientHttpRequest request)ClientHttpResponseRequestExpectationManager. validateRequest(ClientHttpRequest request)Validate the given actual request against the declared expectations.protected ClientHttpResponseAbstractRequestExpectationManager. validateRequestInternal(ClientHttpRequest request)已过时。as of 5.0.3, subclasses should implementAbstractRequestExpectationManager.matchRequest(ClientHttpRequest)instead and return only the matched expectation, leaving the call to create the response as a separate step (to be invoked by this class).org.springframework.test.web.client.response中ClientHttpRequest的使用
参数类型为ClientHttpRequest的org.springframework.test.web.client.response中的方法 修饰符和类型 方法 说明 ClientHttpResponseDefaultResponseCreator. createResponse(ClientHttpRequest request)org.springframework.web.client中ClientHttpRequest的使用
参数类型为ClientHttpRequest的org.springframework.web.client中的方法 修饰符和类型 方法 说明 voidRequestCallback. doWithRequest(ClientHttpRequest request)