Package com.foxinmy.weixin4j.http
Class AbstractHttpClient
- java.lang.Object
-
- com.foxinmy.weixin4j.http.AbstractHttpClient
-
- All Implemented Interfaces:
HttpClient
- Direct Known Subclasses:
HttpComponent3,HttpComponent4,Netty4HttpClient,OkHttpClient2,OkHttpClient3,SimpleHttpClient
public abstract class AbstractHttpClient extends Object implements HttpClient
-
-
Constructor Summary
Constructors Constructor Description AbstractHttpClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(String url)voiddelete(String url, URLParameter... parameters)protected HttpResponseexecute(HttpMethod method, String url)protected HttpResponseexecute(HttpMethod method, String url, URLParameter... parameters)HttpResponseget(String url)HttpResponseget(String url, URLParameter... parameters)protected voidhandleResponse(HttpResponse response)protected booleanhasError(HttpStatus status)HttpHeadershead(String url)HttpHeadershead(String url, URLParameter... parameters)Set<HttpMethod>options(String url)Set<HttpMethod>options(String url, URLParameter... parameters)HttpResponsepost(String url)HttpResponsepost(String url, HttpEntity entity)HttpResponsepost(String url, URLParameter... parameters)voidput(String url)voidput(String url, URLParameter... parameters)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.foxinmy.weixin4j.http.HttpClient
execute
-
-
-
-
Method Detail
-
get
public HttpResponse get(String url) throws HttpClientException
- Specified by:
getin interfaceHttpClient- Throws:
HttpClientException
-
get
public HttpResponse get(String url, URLParameter... parameters) throws HttpClientException
- Specified by:
getin interfaceHttpClient- Throws:
HttpClientException
-
head
public HttpHeaders head(String url) throws HttpClientException
- Specified by:
headin interfaceHttpClient- Throws:
HttpClientException
-
head
public HttpHeaders head(String url, URLParameter... parameters) throws HttpClientException
- Specified by:
headin interfaceHttpClient- Throws:
HttpClientException
-
post
public HttpResponse post(String url) throws HttpClientException
- Specified by:
postin interfaceHttpClient- Throws:
HttpClientException
-
post
public HttpResponse post(String url, URLParameter... parameters) throws HttpClientException
- Specified by:
postin interfaceHttpClient- Throws:
HttpClientException
-
post
public HttpResponse post(String url, HttpEntity entity) throws HttpClientException
- Specified by:
postin interfaceHttpClient- Throws:
HttpClientException
-
put
public void put(String url) throws HttpClientException
- Specified by:
putin interfaceHttpClient- Throws:
HttpClientException
-
put
public void put(String url, URLParameter... parameters) throws HttpClientException
- Specified by:
putin interfaceHttpClient- Throws:
HttpClientException
-
delete
public void delete(String url) throws HttpClientException
- Specified by:
deletein interfaceHttpClient- Throws:
HttpClientException
-
delete
public void delete(String url, URLParameter... parameters) throws HttpClientException
- Specified by:
deletein interfaceHttpClient- Throws:
HttpClientException
-
options
public Set<HttpMethod> options(String url) throws HttpClientException
- Specified by:
optionsin interfaceHttpClient- Throws:
HttpClientException
-
options
public Set<HttpMethod> options(String url, URLParameter... parameters) throws HttpClientException
- Specified by:
optionsin interfaceHttpClient- Throws:
HttpClientException
-
execute
protected HttpResponse execute(HttpMethod method, String url) throws HttpClientException
- Throws:
HttpClientException
-
execute
protected HttpResponse execute(HttpMethod method, String url, URLParameter... parameters) throws HttpClientException
- Throws:
HttpClientException
-
hasError
protected boolean hasError(HttpStatus status)
-
handleResponse
protected void handleResponse(HttpResponse response) throws HttpClientException
- Throws:
HttpClientException
-
-