Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public class ConnectionRequestHttpTransport

  1. Object
  2. ConnectionRequestHttpTransport

ImplementsCloudHttpTransport

The default CloudHttpTransport, built on ConnectionRequest and the NetworkManager queue.

Constructors

public ConnectionRequestHttpTransport()

Methods

public void setTimeout(int timeout)Sets the request timeout in milliseconds.
public void send(String method, String url, Map<String, String> headers, byte[] body, CloudHttpTransport.Handler handler)Sends one request.

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

timeout int
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

method String
the HTTP method, GET, POST, PATCH or DELETE
url String
the full URL, query string included
headers Map<String, String>
request headers, may be null
body byte[]
the request body, or null for none
handler CloudHttpTransport.Handler
receives the response on the EDT. Status 0 means a network failure.