Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public class ConnectionRequestHttpTransport
- Object
- ConnectionRequestHttpTransport
ImplementsCloudHttpTransport
The default
CloudHttpTransport, built on ConnectionRequest and the
NetworkManager queue.Constructors
public ConnectionRequestHttpTransport() |
Methods
Inherited nested types
Inherited methods
Constructor details
ConnectionRequestHttpTransport
public ConnectionRequestHttpTransport()Method details
setTimeout
public void setTimeout(int timeout)Sets the request timeout in milliseconds. The default is 60 seconds.
Parameters
timeoutint- the timeout in milliseconds
send
public void send(String method, String url, Map<String, String> headers, byte[] body, CloudHttpTransport.Handler handler)Sends one request.
Parameters
methodString- the HTTP method,
GET,POST,PATCHorDELETE urlString- the full URL, query string included
headersMap<String, String>- request headers, may be null
bodybyte[]- the request body, or null for none
handlerCloudHttpTransport.Handler- receives the response on the EDT. Status 0 means a network failure.