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

public interface TerminalTransport

Known subtypesHttpTerminalTransport

How a network terminal reaches its provider: one HTTP exchange.

HttpTerminalTransport is the default and goes through Codename One’s network stack. Supply another to route requests through your own server (so the credential never ships in the app), to add tracing, or to script a test.

Nested types

interface TerminalTransport.Callback

Fields

public static final TerminalTransport.Callback IGNOREReceives the outcome of one send.

Methods

public abstract void send(String method, String url, Map<String, String> headers, String contentType, String body, TerminalTransport.Callback callback)Performs one request.

Field details

IGNORE

public static final TerminalTransport.Callback IGNORE
Receives the outcome of one send. A callback that ignores the answer: for a request whose outcome some other request reports, such as a cancel.

Method details

send

public abstract void send(String method, String url, Map<String, String> headers, String contentType, String body, TerminalTransport.Callback callback)
Performs one request. Exactly one of the callback’s methods must be called, on the EDT.

Parameters

method String
GET or POST
url String
the absolute URL
headers Map<String, String>
request headers; may be empty, never null
contentType String
the body’s content type, or null for a bodiless request
body String
the request body, or null
callback TerminalTransport.Callback
receives the outcome