|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface URLFetchService
The URLFetchService
provides a way for user code to execute
HTTP requests to external URLs.
Chunked and hanging requests are not supported, and all content will be returned in a single block.
Method Summary | |
---|---|
HTTPResponse |
fetch(HTTPRequest request)
Execute the specified request and return its response. |
HTTPResponse |
fetch(java.net.URL url)
Convenience method for retrieving a specific URL via a HTTP GET request with no custom headers and default values for all FetchOptions attributes. |
java.util.concurrent.Future<HTTPResponse> |
fetchAsync(HTTPRequest request)
Asynchronously execute the specified request and return its response. |
java.util.concurrent.Future<HTTPResponse> |
fetchAsync(java.net.URL url)
Convenience method for asynchronously retrieving a specific URL via a HTTP GET request with no custom headers and default values for all FetchOptions attributes. |
Method Detail |
---|
HTTPResponse fetch(java.net.URL url) throws java.io.IOException
FetchOptions
attributes. For more complex requests, use
fetch(HTTPRequest)
.
url
- The url to fetch.
java.net.MalformedURLException
- If the provided URL is malformed.
java.io.IOException
- If the remote service could not be contacted or the
URL could not be fetched.
ResponseTooLargeException
- If the response is too large.HTTPResponse fetch(HTTPRequest request) throws java.io.IOException
request
- The http request.
java.lang.IllegalArgumentException
- If request.getMethod
is not
supported by the URLFetchService
.
java.net.MalformedURLException
- If the provided URL is malformed.
java.io.IOException
- If the remote service could not be contacted or the
URL could not be fetched.
ResponseTooLargeException
- If response truncation has been disabled
via the FetchOptions
object on request
and the response is
too large. Some responses are too large to even retrieve from the remote
server, and in these cases the exception is thrown even if response
truncation is enabled.java.util.concurrent.Future<HTTPResponse> fetchAsync(java.net.URL url)
FetchOptions
attributes. For more complex
requests, use fetchAsync(HTTPRequest)
.
url
- The url to fetch.
fetch(URL)
.java.util.concurrent.Future<HTTPResponse> fetchAsync(HTTPRequest request)
request
- The http request.
fetch(HTTPRequest)
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |