Package org.codelibs.curl
Class CurlRequest
- java.lang.Object
-
- org.codelibs.curl.CurlRequest
-
public class CurlRequest extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCurlRequest.RequestProcessor
-
Field Summary
Fields Modifier and Type Field Description protected Stringbodyprotected Stringcompressionprotected Stringencodingprotected static StringGZIPprotected List<String[]>headerListprotected static Loggerloggerprotected Curl.Methodmethodprotected List<String>paramListprotected Proxyproxyprotected SSLSocketFactorysslSocketFactoryprotected ForkJoinPoolthreadPoolprotected intthresholdprotected Stringurl
-
Constructor Summary
Constructors Constructor Description CurlRequest(Curl.Method method, String url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringbody()CurlRequestbody(String body)CurlRequestcompression(String compression)voidconnect(Consumer<HttpURLConnection> actionListener, Consumer<Exception> exceptionListener)protected Stringencode(String value)Stringencoding()CurlRequestencoding(String encoding)CurlResponseexecute()voidexecute(Consumer<CurlResponse> actionListener, Consumer<Exception> exceptionListener)CurlRequestgzip()CurlRequestheader(String key, String value)Curl.Methodmethod()CurlRequestonConnect(BiConsumer<CurlRequest,HttpURLConnection> connectionBuilder)protected HttpURLConnectionopen(URL u)CurlRequestparam(String key, String value)Proxyproxy()CurlRequestproxy(Proxy proxy)CurlRequestsslSocketFactory(SSLSocketFactory sslSocketFactory)CurlRequestthreadPool(ForkJoinPool threadPool)intthreshold()CurlRequestthreshold(int threshold)
-
-
-
Field Detail
-
GZIP
protected static final String GZIP
- See Also:
- Constant Field Values
-
logger
protected static final Logger logger
-
url
protected String url
-
proxy
protected Proxy proxy
-
encoding
protected String encoding
-
threshold
protected int threshold
-
method
protected Curl.Method method
-
body
protected String body
-
compression
protected String compression
-
sslSocketFactory
protected SSLSocketFactory sslSocketFactory
-
threadPool
protected ForkJoinPool threadPool
-
-
Constructor Detail
-
CurlRequest
public CurlRequest(Curl.Method method, String url)
-
-
Method Detail
-
proxy
public Proxy proxy()
-
encoding
public String encoding()
-
threshold
public int threshold()
-
method
public Curl.Method method()
-
body
public String body()
-
proxy
public CurlRequest proxy(Proxy proxy)
-
encoding
public CurlRequest encoding(String encoding)
-
threshold
public CurlRequest threshold(int threshold)
-
gzip
public CurlRequest gzip()
-
compression
public CurlRequest compression(String compression)
-
sslSocketFactory
public CurlRequest sslSocketFactory(SSLSocketFactory sslSocketFactory)
-
body
public CurlRequest body(String body)
-
onConnect
public CurlRequest onConnect(BiConsumer<CurlRequest,HttpURLConnection> connectionBuilder)
-
param
public CurlRequest param(String key, String value)
-
header
public CurlRequest header(String key, String value)
-
connect
public void connect(Consumer<HttpURLConnection> actionListener, Consumer<Exception> exceptionListener)
-
open
protected HttpURLConnection open(URL u) throws IOException
- Throws:
IOException
-
execute
public void execute(Consumer<CurlResponse> actionListener, Consumer<Exception> exceptionListener)
-
execute
public CurlResponse execute()
-
threadPool
public CurlRequest threadPool(ForkJoinPool threadPool)
-
-