Package | Description |
---|---|
com.codename1.io.rest |
Simplified REST API
|
Modifier and Type | Method and Description |
---|---|
RequestBuilder |
RequestBuilder.acceptJson()
Add accept json header to the request
|
RequestBuilder |
RequestBuilder.basicAuth(String username,
String password)
Add a basic authentication Authorization header
|
RequestBuilder |
RequestBuilder.bearer(String token)
Add an authorization bearer header, this is shorthand for
header("Authorization", "Bearer " + token) |
RequestBuilder |
RequestBuilder.body(Data body)
Sets the request body lazily.
|
RequestBuilder |
RequestBuilder.body(PropertyBusinessObject body)
Sets the request body to the JSON matching the given object
|
RequestBuilder |
RequestBuilder.body(String bodyContent)
Sets the request body
|
RequestBuilder |
RequestBuilder.cacheMode(ConnectionRequest.CachingMode cache)
Sets the caching mode for this request, see
ConnectionRequest.getCacheMode() |
RequestBuilder |
RequestBuilder.contentType(String s)
Sets the value of the content type
|
static RequestBuilder |
Rest.delete(String url)
Creates a DELETE request builder
|
static RequestBuilder |
Rest.get(String url)
Creates a GET request builder
|
RequestBuilder |
RequestBuilder.gzip()
Deprecated.
this API was implemented incorrectly
|
static RequestBuilder |
Rest.head(String url)
Creates a HEAD request builder
|
RequestBuilder |
RequestBuilder.header(String key,
String value)
Add a header to the request
|
RequestBuilder |
RequestBuilder.jsonContent()
Sets both the content type and accept headers to "application/json"
|
RequestBuilder |
RequestBuilder.onError(ActionListener<NetworkEvent> error)
Invoked for exceptions or failures such as disconnect.
|
RequestBuilder |
RequestBuilder.onError(ActionListener<NetworkEvent> error,
boolean replace)
Invoked for exceptions or failures such as disconnect
|
RequestBuilder |
RequestBuilder.onErrorCode(ErrorCodeHandler<PropertyBusinessObject> err,
Class errorClass)
In case of an error this method is invoked asynchronously to process
the error content with the JSON data and places it into a business
object in the callback
|
RequestBuilder |
RequestBuilder.onErrorCodeBytes(ErrorCodeHandler<byte[]> err)
In case of an error this method is invoked asynchronously to process
the error content with the byte array data
|
RequestBuilder |
RequestBuilder.onErrorCodeJSON(ErrorCodeHandler<Map> err)
In case of an error this method is invoked asynchronously to process
the error content with the JSON data
|
RequestBuilder |
RequestBuilder.onErrorCodeString(ErrorCodeHandler<String> err)
In case of an error this method is invoked asynchronously to process
the error content with the JSON data
|
static RequestBuilder |
Rest.options(String url)
Creates a OPTIONS request builder
|
static RequestBuilder |
Rest.patch(String url)
Creates a PATCH request builder
|
RequestBuilder |
RequestBuilder.pathParam(String key,
String value)
Add a path param to the request.
|
static RequestBuilder |
Rest.post(String url)
Creates a POST request builder
|
static RequestBuilder |
Rest.put(String url)
Creates a PUT request builder
|
RequestBuilder |
RequestBuilder.queryParam(String key,
String value)
Add a query parameter to the request
|
RequestBuilder |
RequestBuilder.readTimeout(int timeout)
Sets the request read timeout.
|
RequestBuilder |
RequestBuilder.timeout(int timeout)
Sets the request timeout
|
Copyright © 2021. All rights reserved.