Package io.servicetalk.http.api
Interface BlockingHttpRequester
-
- All Superinterfaces:
java.lang.AutoCloseable,GracefulAutoCloseable,HttpRequestFactory
- All Known Subinterfaces:
BlockingHttpClient,BlockingHttpConnection,ReservedBlockingHttpConnection
public interface BlockingHttpRequester extends HttpRequestFactory, GracefulAutoCloseable
The equivalent ofHttpRequesterwith synchronous/blocking APIs instead of asynchronous APIs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidclose()HttpExecutionContextexecutionContext()Get theHttpExecutionContextused during construction of this object.HttpResponseFactoryhttpResponseFactory()Get aHttpResponseFactory.HttpResponserequest(HttpExecutionStrategy strategy, HttpRequest request)Send arequestusing the passedstrategy.-
Methods inherited from interface io.servicetalk.concurrent.GracefulAutoCloseable
closeGracefully
-
-
-
-
Method Detail
-
request
HttpResponse request(HttpExecutionStrategy strategy, HttpRequest request) throws java.lang.Exception
Send arequestusing the passedstrategy.- Parameters:
strategy-HttpExecutionStrategyto use.request- the request to send.- Returns:
- The response.
- Throws:
java.lang.Exception- if an exception occurs during the request processing.
-
executionContext
HttpExecutionContext executionContext()
Get theHttpExecutionContextused during construction of this object.Note that the
ExecutionContext.ioExecutor()will not necessarily be associated with a specific thread unless that was how this object was built.- Returns:
- the
HttpExecutionContextused during construction of this object.
-
httpResponseFactory
HttpResponseFactory httpResponseFactory()
Get aHttpResponseFactory.- Returns:
- a
HttpResponseFactory.
-
close
default void close() throws java.lang.Exception- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
-