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 void
delete(String url)
void
delete(String url, URLParameter... parameters)
protected HttpResponse
execute(HttpMethod method, String url)
protected HttpResponse
execute(HttpMethod method, String url, URLParameter... parameters)
HttpResponse
get(String url)
HttpResponse
get(String url, URLParameter... parameters)
protected void
handleResponse(HttpResponse response)
protected boolean
hasError(HttpStatus status)
HttpHeaders
head(String url)
HttpHeaders
head(String url, URLParameter... parameters)
Set<HttpMethod>
options(String url)
Set<HttpMethod>
options(String url, URLParameter... parameters)
HttpResponse
post(String url)
HttpResponse
post(String url, HttpEntity entity)
HttpResponse
post(String url, URLParameter... parameters)
void
put(String url)
void
put(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:
get
in interfaceHttpClient
- Throws:
HttpClientException
-
get
public HttpResponse get(String url, URLParameter... parameters) throws HttpClientException
- Specified by:
get
in interfaceHttpClient
- Throws:
HttpClientException
-
head
public HttpHeaders head(String url) throws HttpClientException
- Specified by:
head
in interfaceHttpClient
- Throws:
HttpClientException
-
head
public HttpHeaders head(String url, URLParameter... parameters) throws HttpClientException
- Specified by:
head
in interfaceHttpClient
- Throws:
HttpClientException
-
post
public HttpResponse post(String url) throws HttpClientException
- Specified by:
post
in interfaceHttpClient
- Throws:
HttpClientException
-
post
public HttpResponse post(String url, URLParameter... parameters) throws HttpClientException
- Specified by:
post
in interfaceHttpClient
- Throws:
HttpClientException
-
post
public HttpResponse post(String url, HttpEntity entity) throws HttpClientException
- Specified by:
post
in interfaceHttpClient
- Throws:
HttpClientException
-
put
public void put(String url) throws HttpClientException
- Specified by:
put
in interfaceHttpClient
- Throws:
HttpClientException
-
put
public void put(String url, URLParameter... parameters) throws HttpClientException
- Specified by:
put
in interfaceHttpClient
- Throws:
HttpClientException
-
delete
public void delete(String url) throws HttpClientException
- Specified by:
delete
in interfaceHttpClient
- Throws:
HttpClientException
-
delete
public void delete(String url, URLParameter... parameters) throws HttpClientException
- Specified by:
delete
in interfaceHttpClient
- Throws:
HttpClientException
-
options
public Set<HttpMethod> options(String url) throws HttpClientException
- Specified by:
options
in interfaceHttpClient
- Throws:
HttpClientException
-
options
public Set<HttpMethod> options(String url, URLParameter... parameters) throws HttpClientException
- Specified by:
options
in 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
-
-