Class UrlRequestTransport
java.lang.Object
com.google.web.bindery.requestfactory.vm.testing.UrlRequestTransport
- All Implemented Interfaces:
RequestTransport
A trivial implementation of RequestTransport that uses a
HttpURLConnection. Details of the connection can be amended by
overriding configureConnection(HttpURLConnection).
This implementation only supports http and https URLs. It has
primitive support for recording and playing back cookies, but does not
implement expiration processing.
Developers who wish to build a more production-ready client should consider using a RequestTRansport based around Apache HttpClient instead.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.web.bindery.requestfactory.shared.RequestTransport
RequestTransport.TransportReceiver -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureConnection(HttpURLConnection connection) Provides access to the cookies that will be sent for subsequent requests.voidsend(String payload, RequestTransport.TransportReceiver receiver) Called by the RequestFactory implementation.
-
Constructor Details
-
UrlRequestTransport
Construct a new UrlRequestTransport.- Parameters:
url- the URL to connect to- Throws:
IllegalArgumentException- if the url's protocol is nothttporhttps
-
-
Method Details
-
getCookies
Provides access to the cookies that will be sent for subsequent requests. -
configureConnection
- Throws:
IOException
-