|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HTTPClient
Defines the inteface by which an AbstractOpenWebService
executes HTTP requests.
HTTPResponse
,
SimpleHttpClient
,
AbstractOpenWebService.setHttpClient(HTTPClient)
Method Summary | |
---|---|
HTTPResponse |
get(URL url)
Executes an HTTP GET request against the provided URL and returns the server response. |
int |
getConnectTimeout()
|
String |
getPassword()
|
int |
getReadTimeout()
|
String |
getUser()
|
boolean |
isTryGzip()
|
HTTPResponse |
post(URL url,
InputStream postContent,
String postContentType)
Executes an HTTP POST request against the provided URL, sending the contents of postContent as the POST method body and setting the Content-Type request header to
postContentType if given, and returns the server response. |
void |
setConnectTimeout(int connectTimeout)
|
void |
setPassword(String password)
|
void |
setReadTimeout(int readTimeout)
|
void |
setTryGzip(boolean tryGZIP)
|
void |
setUser(String user)
|
Method Detail |
---|
HTTPResponse post(URL url, InputStream postContent, String postContentType) throws IOException
postContent
as the POST method body and setting the Content-Type request header to
postContentType
if given, and returns the server response.
If an HTTP authentication user
and password
is set,
the appropriate authentication HTTP header will be sent with the request.
If a connection timeout
is set, the http connection will be set
to respect that timeout.
If a read timeout
is set, the http connection will be set to
respect it.
url
- the URL against which to execute the POST requestpostContent
- an input stream with the contents of the POST bodypostContentType
- the MIME type of the contents sent as the request POST body, can be null
HTTPResponse
encapsulating the response to the HTTP POST request
IOException
HTTPResponse get(URL url) throws IOException
If an HTTP authentication user
and password
is set,
the appropriate authentication HTTP header will be sent with the request.
If a connection timeout
is set, the http connection will be set
to respect that timeout.
If a read timeout
is set, the http connection will be set to
respect it.
url
- the URL to retrieve
HTTPResponse
encapsulating the response to the HTTP GET request
IOException
String getUser()
null
if not setvoid setUser(String user)
user
- the HTTP BASIC Authentication user nameString getPassword()
null
if not setvoid setPassword(String password)
password
- the HTTP BASIC Authentication passwordint getConnectTimeout()
void setConnectTimeout(int connectTimeout)
connectTimeout
- tcp/ip connect timeout in secondsint getReadTimeout()
void setReadTimeout(int readTimeout)
readTimeout
- socket read timeout in secondsvoid setTryGzip(boolean tryGZIP)
tryGZIP
- boolean isTryGzip()
false
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |