Class HttpAsyncMethods
java.lang.Object
org.apache.http.nio.client.methods.HttpAsyncMethods
Factory methods for asynchronous request producers and response consumers.
- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.http.nio.protocol.HttpAsyncRequestProducercreate(org.apache.http.client.methods.HttpUriRequest request) Creates asynchronous request generator for the given request message.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreate(org.apache.http.HttpHost target, org.apache.http.HttpRequest request) Creates asynchronous request generator for the given request message.static org.apache.http.nio.protocol.HttpAsyncResponseConsumer<org.apache.http.HttpResponse> Creates basic response consumer that will buffer response content in memory.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreateDelete(String requestURI) Creates asynchronousDELETErequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreateDelete(URI requestURI) Creates asynchronousDELETErequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducerCreates asynchronousGETrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducerCreates asynchronousGETrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreateHead(String requestURI) Creates asynchronousHEADrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreateHead(URI requestURI) Creates asynchronousHEADrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreateOptions(String requestURI) Creates asynchronousOPTIONSrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreateOptions(URI requestURI) Creates asynchronousOPTIONSrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreatePost(String requestURI, byte[] content, org.apache.http.entity.ContentType contentType) Creates asynchronousPOSTrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreatePost(String requestURI, String content, org.apache.http.entity.ContentType contentType) Creates asynchronousPOSTrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreatePost(URI requestURI, byte[] content, org.apache.http.entity.ContentType contentType) Creates asynchronousPOSTrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreatePost(URI requestURI, String content, org.apache.http.entity.ContentType contentType) Creates asynchronousPOSTrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducerCreates asynchronousPUTrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducerCreates asynchronousPUTrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducerCreates asynchronousPUTrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducerCreates asynchronousPUTrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreateTrace(String requestURI) Creates asynchronousTRACErequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreateTrace(URI requestURI) Creates asynchronousTRACErequest generator.static org.apache.http.nio.protocol.HttpAsyncResponseConsumer<org.apache.http.HttpResponse> createZeroCopyConsumer(File file) Creates zero-copy response consumer that will stream response content directly to the given file.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreateZeroCopyPost(String requestURI, File content, org.apache.http.entity.ContentType contentType) Creates asynchronous zero-copyPOSTrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreateZeroCopyPost(URI requestURI, File content, org.apache.http.entity.ContentType contentType) Creates asynchronous zero-copyPOSTrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreateZeroCopyPut(String requestURI, File content, org.apache.http.entity.ContentType contentType) Creates asynchronous zero-copyPUTrequest generator.static org.apache.http.nio.protocol.HttpAsyncRequestProducercreateZeroCopyPut(URI requestURI, File content, org.apache.http.entity.ContentType contentType) Creates asynchronous zero-copyPUTrequest generator.
-
Constructor Details
-
HttpAsyncMethods
public HttpAsyncMethods()
-
-
Method Details
-
create
public static org.apache.http.nio.protocol.HttpAsyncRequestProducer create(org.apache.http.HttpHost target, org.apache.http.HttpRequest request) Creates asynchronous request generator for the given request message.- Parameters:
target- request target.request- request message.- Returns:
- asynchronous request generator
-
create
public static org.apache.http.nio.protocol.HttpAsyncRequestProducer create(org.apache.http.client.methods.HttpUriRequest request) Creates asynchronous request generator for the given request message.- Parameters:
request- request message.- Returns:
- asynchronous request generator
-
createGet
Creates asynchronousGETrequest generator.- Parameters:
requestURI- request URI.- Returns:
- asynchronous request generator
-
createGet
Creates asynchronousGETrequest generator.- Parameters:
requestURI- request URI.- Returns:
- asynchronous request generator
-
createHead
Creates asynchronousHEADrequest generator.- Parameters:
requestURI- request URI.- Returns:
- asynchronous request generator
-
createHead
Creates asynchronousHEADrequest generator.- Parameters:
requestURI- request URI.- Returns:
- asynchronous request generator
-
createDelete
Creates asynchronousDELETErequest generator.- Parameters:
requestURI- request URI.- Returns:
- asynchronous request generator
-
createDelete
Creates asynchronousDELETErequest generator.- Parameters:
requestURI- request URI.- Returns:
- asynchronous request generator
-
createOptions
Creates asynchronousOPTIONSrequest generator.- Parameters:
requestURI- request URI.- Returns:
- asynchronous request generator
-
createOptions
public static org.apache.http.nio.protocol.HttpAsyncRequestProducer createOptions(String requestURI) Creates asynchronousOPTIONSrequest generator.- Parameters:
requestURI- request URI.- Returns:
- asynchronous request generator
-
createTrace
Creates asynchronousTRACErequest generator.- Parameters:
requestURI- request URI.- Returns:
- asynchronous request generator
-
createTrace
Creates asynchronousTRACErequest generator.- Parameters:
requestURI- request URI.- Returns:
- asynchronous request generator
-
createPost
public static org.apache.http.nio.protocol.HttpAsyncRequestProducer createPost(URI requestURI, String content, org.apache.http.entity.ContentType contentType) throws UnsupportedEncodingException Creates asynchronousPOSTrequest generator.- Parameters:
requestURI- request URI.content- request content.contentType- request contentType.- Returns:
- asynchronous request generator
- Throws:
UnsupportedEncodingException
-
createPost
public static org.apache.http.nio.protocol.HttpAsyncRequestProducer createPost(String requestURI, String content, org.apache.http.entity.ContentType contentType) throws UnsupportedEncodingException Creates asynchronousPOSTrequest generator.- Parameters:
requestURI- request URI.content- request content.contentType- request contentType.- Returns:
- asynchronous request generator
- Throws:
UnsupportedEncodingException
-
createPost
public static org.apache.http.nio.protocol.HttpAsyncRequestProducer createPost(URI requestURI, byte[] content, org.apache.http.entity.ContentType contentType) Creates asynchronousPOSTrequest generator.- Parameters:
requestURI- request URI.content- request content.contentType- request contentType.- Returns:
- asynchronous request generator
-
createPost
public static org.apache.http.nio.protocol.HttpAsyncRequestProducer createPost(String requestURI, byte[] content, org.apache.http.entity.ContentType contentType) Creates asynchronousPOSTrequest generator.- Parameters:
requestURI- request URI.content- request content.contentType- request contentType.- Returns:
- asynchronous request generator
-
createPut
public static org.apache.http.nio.protocol.HttpAsyncRequestProducer createPut(URI requestURI, String content, org.apache.http.entity.ContentType contentType) throws UnsupportedEncodingException Creates asynchronousPUTrequest generator.- Parameters:
requestURI- request URI.content- request content.contentType- request contentType.- Returns:
- asynchronous request generator
- Throws:
UnsupportedEncodingException
-
createPut
public static org.apache.http.nio.protocol.HttpAsyncRequestProducer createPut(String requestURI, String content, org.apache.http.entity.ContentType contentType) throws UnsupportedEncodingException Creates asynchronousPUTrequest generator.- Parameters:
requestURI- request URI.content- request content.contentType- request contentType.- Returns:
- asynchronous request generator
- Throws:
UnsupportedEncodingException
-
createPut
public static org.apache.http.nio.protocol.HttpAsyncRequestProducer createPut(URI requestURI, byte[] content, org.apache.http.entity.ContentType contentType) Creates asynchronousPUTrequest generator.- Parameters:
requestURI- request URI.content- request content.contentType- request contentType.- Returns:
- asynchronous request generator
-
createPut
public static org.apache.http.nio.protocol.HttpAsyncRequestProducer createPut(String requestURI, byte[] content, org.apache.http.entity.ContentType contentType) Creates asynchronousPUTrequest generator.- Parameters:
requestURI- request URI.content- request content.contentType- request contentType.- Returns:
- asynchronous request generator
-
createZeroCopyPost
public static org.apache.http.nio.protocol.HttpAsyncRequestProducer createZeroCopyPost(URI requestURI, File content, org.apache.http.entity.ContentType contentType) throws FileNotFoundException Creates asynchronous zero-copyPOSTrequest generator.- Parameters:
requestURI- request URI.content- request content.contentType- request contentType.- Returns:
- asynchronous request generator
- Throws:
FileNotFoundException
-
createZeroCopyPost
public static org.apache.http.nio.protocol.HttpAsyncRequestProducer createZeroCopyPost(String requestURI, File content, org.apache.http.entity.ContentType contentType) throws FileNotFoundException Creates asynchronous zero-copyPOSTrequest generator.- Parameters:
requestURI- request URI.content- request content.contentType- request contentType.- Returns:
- asynchronous request generator
- Throws:
FileNotFoundException
-
createZeroCopyPut
public static org.apache.http.nio.protocol.HttpAsyncRequestProducer createZeroCopyPut(URI requestURI, File content, org.apache.http.entity.ContentType contentType) throws FileNotFoundException Creates asynchronous zero-copyPUTrequest generator.- Parameters:
requestURI- request URI.content- request content.contentType- request contentType.- Returns:
- asynchronous request generator
- Throws:
FileNotFoundException
-
createZeroCopyPut
public static org.apache.http.nio.protocol.HttpAsyncRequestProducer createZeroCopyPut(String requestURI, File content, org.apache.http.entity.ContentType contentType) throws FileNotFoundException Creates asynchronous zero-copyPUTrequest generator.- Parameters:
requestURI- request URI.content- request content.contentType- request contentType.- Returns:
- asynchronous request generator
- Throws:
FileNotFoundException
-
createConsumer
public static org.apache.http.nio.protocol.HttpAsyncResponseConsumer<org.apache.http.HttpResponse> createConsumer()Creates basic response consumer that will buffer response content in memory.- Returns:
- asynchronous response consumer.
-
createZeroCopyConsumer
public static org.apache.http.nio.protocol.HttpAsyncResponseConsumer<org.apache.http.HttpResponse> createZeroCopyConsumer(File file) throws FileNotFoundException Creates zero-copy response consumer that will stream response content directly to the given file.- Returns:
- asynchronous response consumer.
- Throws:
FileNotFoundException
-