public abstract class Sender extends java.lang.Object implements java.util.concurrent.Callable<Response>
限定符和类型 | 字段和说明 |
---|---|
protected Callback<Response> |
callback |
protected java.net.HttpURLConnection |
conn |
static int |
Default_Conn_Timeout
默认连接超时, 30秒
|
static int |
Default_Read_Timeout
默认读取超时, 10分钟
|
protected static java.util.concurrent.ExecutorService |
es |
protected boolean |
followRedirects |
protected HttpReqRespInterceptor |
interceptor |
protected Callback<java.lang.Integer> |
progressListener |
protected Request |
request |
限定符和类型 | 方法和说明 |
---|---|
Response |
call() |
static Sender |
create(Request request) |
static Sender |
create(Request request,
int timeout) |
static Sender |
create(java.lang.String url) |
static Sender |
create(java.lang.String url,
int timeout) |
protected Response |
createResponse(java.util.Map<java.lang.String,java.lang.String> reHeaders) |
int |
getEstimationSize() |
static java.util.concurrent.ExecutorService |
getExecutorService() |
protected java.io.OutputStream |
getOutputStream() |
protected java.util.Map<java.lang.String,java.lang.String> |
getResponseHeader() |
int |
getTimeout() |
protected void |
openConnection() |
abstract Response |
send() |
java.util.concurrent.Future<Response> |
send(Callback<Response> callback) |
Sender |
setCallback(Callback<Response> callback) |
Sender |
setFollowRedirects(boolean followRedirects) |
Sender |
setInterceptor(HttpReqRespInterceptor interceptor) |
Sender |
setProgressListener(Callback<java.lang.Integer> progressListener) |
Sender |
setTimeout(int timeout) |
static java.util.concurrent.ExecutorService |
setup(java.util.concurrent.ExecutorService es) |
protected void |
setupDoInputOutputFlag() |
protected void |
setupRequestHeader() |
static java.util.List<java.lang.Runnable> |
shutdown() |
public static int Default_Conn_Timeout
public static int Default_Read_Timeout
protected Request request
protected java.net.HttpURLConnection conn
protected HttpReqRespInterceptor interceptor
protected boolean followRedirects
protected Callback<java.lang.Integer> progressListener
protected static java.util.concurrent.ExecutorService es
protected Sender(Request request)
public static Sender create(java.lang.String url)
public static Sender create(java.lang.String url, int timeout)
public abstract Response send() throws HttpException
HttpException
protected Response createResponse(java.util.Map<java.lang.String,java.lang.String> reHeaders) throws java.io.IOException
java.io.IOException
protected java.util.Map<java.lang.String,java.lang.String> getResponseHeader() throws java.io.IOException
java.io.IOException
protected void setupDoInputOutputFlag()
protected void openConnection() throws java.io.IOException
java.io.IOException
protected void setupRequestHeader()
public Sender setTimeout(int timeout)
public int getTimeout()
public Sender setInterceptor(HttpReqRespInterceptor interceptor)
public Response call() throws java.lang.Exception
call
在接口中 java.util.concurrent.Callable<Response>
java.lang.Exception
public java.util.concurrent.Future<Response> send(Callback<Response> callback) throws HttpException
HttpException
public static java.util.concurrent.ExecutorService setup(java.util.concurrent.ExecutorService es)
public static java.util.List<java.lang.Runnable> shutdown()
public static java.util.concurrent.ExecutorService getExecutorService()
public Sender setFollowRedirects(boolean followRedirects)
protected java.io.OutputStream getOutputStream() throws java.io.IOException
java.io.IOException
public int getEstimationSize() throws java.io.IOException
java.io.IOException