public class HttpRequestBuilder extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
acceptedEncodings |
protected String |
acceptedLanguages |
protected String |
acceptedMimeTypes |
protected String |
charSet |
protected String |
connectionHeader |
protected static String |
proxyHost |
protected static String |
proxyPassword |
protected static int |
proxyPort |
protected static String |
proxyUsername |
protected Set<Integer> |
redirectStatusCodes |
protected String |
userAgent |
| Constructor and Description |
|---|
HttpRequestBuilder() |
HttpRequestBuilder(HttpRequestBuilder that) |
| Modifier and Type | Method and Description |
|---|---|
HttpRequestBuilder |
acceptedLanguages(String acceptedLanguages) |
HttpRequestBuilder |
acceptedMimeTypes(String acceptedMimeTypes) |
HttpRequestBuilder |
charSet(String charSet) |
Request |
CONNECT(URI uri,
io.netty.handler.codec.http.HttpVersion version,
Reader reader) |
Request |
CONNECT(URI uri,
Reader reader)
See
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a file |
HttpRequestBuilder |
connection(String connectionHeader) |
HttpRequestBuilder |
copy()
Create a new instance of
HttpRequestBuilder copying all the settings from this
instance to the new one |
Request |
DELETE(URI uri,
io.netty.handler.codec.http.HttpVersion version,
Reader reader) |
Request |
DELETE(URI uri,
Reader reader)
See
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a file |
Request |
GET(URI uri,
io.netty.handler.codec.http.HttpVersion version,
Reader reader) |
Request |
GET(URI uri,
Reader reader)
See
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a file |
static String[] |
getSupportedSSLProtocols()
Gets the list of SSL protocols supported by the current JVM
|
static io.netty.channel.EventLoopGroup |
group() |
Request |
HEAD(URI uri,
io.netty.handler.codec.http.HttpVersion version,
Reader reader) |
Request |
HEAD(URI uri,
Reader reader)
See
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a file |
static HttpRequestBuilder |
instance() |
static boolean |
isSupportedSSLProtocol(String protocol)
Checks if the given SSL protocol is supported by the current JVM
|
Request |
OPTIONS(URI uri,
io.netty.handler.codec.http.HttpVersion version,
Reader reader) |
Request |
OPTIONS(URI uri,
Reader reader)
See
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a file |
Request |
PATCH(URI uri,
io.netty.handler.codec.http.HttpVersion version,
Reader reader) |
Request |
PATCH(URI uri,
Reader reader)
See
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a file |
POST |
POST(URI uri,
io.netty.handler.codec.http.HttpVersion version,
Reader reader) |
POST |
POST(URI uri,
Reader reader)
See
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a file |
JSONRequest |
postJSON(URI uri,
io.netty.handler.codec.http.HttpVersion version,
Reader reader) |
JSONRequest |
postJSON(URI uri,
Reader reader)
See
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a file |
HttpRequestBuilder |
proxy(String host,
int port) |
HttpRequestBuilder |
proxy(String host,
int port,
String username,
String password)
Sets proxy information what will be used to make all requests made using the client
i.e.
|
JSONRequest |
putJSON(URI uri,
io.netty.handler.codec.http.HttpVersion version,
Reader reader) |
JSONRequest |
putJSON(URI uri,
Reader reader) |
Set<Integer> |
redirectOn() |
HttpRequestBuilder |
redirectOn(int... codes)
Automatically follow redirect responses for the given status codes
|
static void |
restart() |
static void |
shutdown() |
HTTPStreamingRequest |
streamJSON(URI uri,
Reader reader) |
Request |
TRACE(URI uri,
io.netty.handler.codec.http.HttpVersion version,
Reader reader) |
Request |
TRACE(URI uri,
Reader reader)
See
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a file |
HttpRequestBuilder |
userAgent(String userAgent) |
protected static String proxyHost
protected static String proxyUsername
protected static String proxyPassword
protected static int proxyPort
protected String userAgent
protected String charSet
protected String acceptedLanguages
protected String acceptedMimeTypes
protected String acceptedEncodings
protected String connectionHeader
public HttpRequestBuilder(HttpRequestBuilder that)
public HttpRequestBuilder()
public static HttpRequestBuilder instance()
public static io.netty.channel.EventLoopGroup group()
public static void restart()
public static void shutdown()
public static boolean isSupportedSSLProtocol(String protocol)
protocol - e.g. SSLv2Hello, SSLv3, TLSv1, TLSv1.1, TLSv1.2IllegalArgumentException - if the given protocol is null or emptypublic static String[] getSupportedSSLProtocols()
public HttpRequestBuilder proxy(String host, int port)
public HttpRequestBuilder proxy(String host, int port, String username, String password)
host - the proxy hostport - the proxy portusername - username for the proxypassword - password for the proxypublic HttpRequestBuilder redirectOn(int... codes)
codes - the status codes to treat as redirectspublic Request GET(URI uri, Reader reader)
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a fileuri - the URI to make the request toreader - the reader to use to process the responsepublic POST POST(URI uri, Reader reader)
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a fileuri - the URI to make the request toreader - the reader to use to process the responsepublic HTTPStreamingRequest streamJSON(URI uri, Reader reader)
public JSONRequest postJSON(URI uri, Reader reader)
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a fileuri - the URI to make the request toreader - the reader to use to process the responsepublic JSONRequest postJSON(URI uri, io.netty.handler.codec.http.HttpVersion version, Reader reader)
public JSONRequest putJSON(URI uri, Reader reader)
public JSONRequest putJSON(URI uri, io.netty.handler.codec.http.HttpVersion version, Reader reader)
public Request DELETE(URI uri, Reader reader)
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a fileuri - the URI to make the request toreader - the reader to use to process the responsepublic Request DELETE(URI uri, io.netty.handler.codec.http.HttpVersion version, Reader reader)
public Request OPTIONS(URI uri, Reader reader)
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a fileuri - the URI to make the request toreader - the reader to use to process the responsepublic Request OPTIONS(URI uri, io.netty.handler.codec.http.HttpVersion version, Reader reader)
public Request HEAD(URI uri, Reader reader)
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a fileuri - the URI to make the request toreader - the reader to use to process the responsepublic Request TRACE(URI uri, Reader reader)
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a fileuri - the URI to make the request toreader - the reader to use to process the responsepublic Request PATCH(URI uri, Reader reader)
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a fileuri - the URI to make the request toreader - the reader to use to process the responsepublic Request CONNECT(URI uri, Reader reader)
Reader for handling incoming data and the default implementations
PageReader which reads an entire page
LineReader which reads a response line by line
or
FileReader which reads a response and saves it to a fileuri - the URI to make the request toreader - the reader to use to process the responsepublic Request CONNECT(URI uri, io.netty.handler.codec.http.HttpVersion version, Reader reader)
public HttpRequestBuilder acceptedLanguages(String acceptedLanguages)
public HttpRequestBuilder acceptedMimeTypes(String acceptedMimeTypes)
public HttpRequestBuilder charSet(String charSet)
public HttpRequestBuilder userAgent(String userAgent)
public HttpRequestBuilder connection(String connectionHeader)
connectionHeader - the connection header to use on requests. by default = CLOSEpublic HttpRequestBuilder copy()
HttpRequestBuilder copying all the settings from this
instance to the new oneCopyright © 2012-2015. All Rights Reserved.