fm.liveswitch.HttpTransfer Class Referenceabstract

Base class that defines methods for transferring content over HTTP. More...

Public Member Functions

fm.liveswitch.HttpResponseArgs send (fm.liveswitch.HttpRequestArgs requestArgs)
 Sends a request synchronously. More...
 
void sendAsync (fm.liveswitch.HttpRequestArgs requestArgs, fm.liveswitch.IAction1< fm.liveswitch.HttpResponseArgs > callback)
 Sends a request asynchronously. More...
 
abstract fm.liveswitch.HttpResponseArgs sendBinary (fm.liveswitch.HttpRequestArgs requestArgs)
 Sends binary content synchronously using the specified arguments. More...
 
abstract void sendBinaryAsync (fm.liveswitch.HttpRequestArgs requestArgs, fm.liveswitch.IAction1< fm.liveswitch.HttpResponseArgs > callback)
 Sends binary content asynchronously using the specified arguments. More...
 
abstract fm.liveswitch.HttpResponseArgs sendText (fm.liveswitch.HttpRequestArgs requestArgs)
 Sends text content synchronously using the specified arguments. More...
 
abstract void sendTextAsync (fm.liveswitch.HttpRequestArgs requestArgs, fm.liveswitch.IAction1< fm.liveswitch.HttpResponseArgs > callback)
 Sends text content asynchronously using the specified arguments. More...
 
abstract void shutdown ()
 Releases any resources and shuts down. More...
 

Static Public Member Functions

static void addOnSendFinish (fm.liveswitch.IAction1< fm.liveswitch.HttpSendFinishArgs > value)
 Adds a handler that is raised before an HTTP request is sent. More...
 
static void addOnSendStart (fm.liveswitch.IAction1< fm.liveswitch.HttpSendStartArgs > value)
 Adds a handler that is raised before an HTTP request is sent. More...
 
static String addQueryToUrl (String url, String key)
 Escapes and adds a query parameter as a key/empty-value pair to a URL. More...
 
static String addQueryToUrl (String url, String key, String value)
 Escapes and adds a query parameter as a key/value pair to a URL. More...
 
static String getRandomWildcardCharacter ()
 Gets a random wildcard character. More...
 
static String getWildcardCharacters ()
 Gets the wildcard characters used to replace asterisks in ReplaceWildcards. More...
 
static void removeOnSendFinish (fm.liveswitch.IAction1< fm.liveswitch.HttpSendFinishArgs > value)
 Removes a handler that is raised before an HTTP request is sent. More...
 
static void removeOnSendStart (fm.liveswitch.IAction1< fm.liveswitch.HttpSendStartArgs > value)
 Removes a handler that is raised before an HTTP request is sent. More...
 
static String replaceWildcards (String url)
 Replaces asterisks in URLs with characters from WildcardCharacters. More...
 
static void setWildcardCharacters (String value)
 Sets the wildcard characters used to replace asterisks in ReplaceWildcards. More...
 

Protected Member Functions

 HttpTransfer ()
 

Detailed Description

Base class that defines methods for transferring content over HTTP.

Constructor & Destructor Documentation

◆ HttpTransfer()

fm.liveswitch.HttpTransfer.HttpTransfer ( )
protected

Member Function Documentation

◆ addOnSendFinish()

static void fm.liveswitch.HttpTransfer.addOnSendFinish ( fm.liveswitch.IAction1< fm.liveswitch.HttpSendFinishArgs value)
static

Adds a handler that is raised before an HTTP request is sent.

◆ addOnSendStart()

static void fm.liveswitch.HttpTransfer.addOnSendStart ( fm.liveswitch.IAction1< fm.liveswitch.HttpSendStartArgs value)
static

Adds a handler that is raised before an HTTP request is sent.

◆ addQueryToUrl() [1/2]

static String fm.liveswitch.HttpTransfer.addQueryToUrl ( String  url,
String  key 
)
static

Escapes and adds a query parameter as a key/empty-value pair to a URL.

Parameters
urlThe URL with the query to which the key/value should be added.
keyThe key of the query parameter to add.
Returns
The original URL with the query parameter added.

◆ addQueryToUrl() [2/2]

static String fm.liveswitch.HttpTransfer.addQueryToUrl ( String  url,
String  key,
String  value 
)
static

Escapes and adds a query parameter as a key/value pair to a URL.

Parameters
urlThe URL with the query to which the key/value should be added.
keyThe key of the query parameter to add.
valueThe value of the query parameter to add.
Returns
The original URL with the query parameter added.

◆ getRandomWildcardCharacter()

static String fm.liveswitch.HttpTransfer.getRandomWildcardCharacter ( )
static

Gets a random wildcard character.

Returns
A random wildcard character.

◆ getWildcardCharacters()

static String fm.liveswitch.HttpTransfer.getWildcardCharacters ( )
static

Gets the wildcard characters used to replace asterisks in ReplaceWildcards.

◆ removeOnSendFinish()

static void fm.liveswitch.HttpTransfer.removeOnSendFinish ( fm.liveswitch.IAction1< fm.liveswitch.HttpSendFinishArgs value)
static

Removes a handler that is raised before an HTTP request is sent.

◆ removeOnSendStart()

static void fm.liveswitch.HttpTransfer.removeOnSendStart ( fm.liveswitch.IAction1< fm.liveswitch.HttpSendStartArgs value)
static

Removes a handler that is raised before an HTTP request is sent.

◆ replaceWildcards()

static String fm.liveswitch.HttpTransfer.replaceWildcards ( String  url)
static

Replaces asterisks in URLs with characters from WildcardCharacters.

Parameters
urlThe URL with asterisks.

◆ send()

fm.liveswitch.HttpResponseArgs fm.liveswitch.HttpTransfer.send ( fm.liveswitch.HttpRequestArgs  requestArgs)

Sends a request synchronously.

Parameters
requestArgsThe request parameters.
Returns
The resulting response.

◆ sendAsync()

void fm.liveswitch.HttpTransfer.sendAsync ( fm.liveswitch.HttpRequestArgs  requestArgs,
fm.liveswitch.IAction1< fm.liveswitch.HttpResponseArgs callback 
)

Sends a request asynchronously.

Parameters
requestArgsThe request parameters.
callbackThe callback to execute with the resulting response.

◆ sendBinary()

abstract fm.liveswitch.HttpResponseArgs fm.liveswitch.HttpTransfer.sendBinary ( fm.liveswitch.HttpRequestArgs  requestArgs)
abstract

Sends binary content synchronously using the specified arguments.

Parameters
requestArgsThe request arguments.
Returns
The response arguments from the server.

◆ sendBinaryAsync()

abstract void fm.liveswitch.HttpTransfer.sendBinaryAsync ( fm.liveswitch.HttpRequestArgs  requestArgs,
fm.liveswitch.IAction1< fm.liveswitch.HttpResponseArgs callback 
)
abstract

Sends binary content asynchronously using the specified arguments.

Parameters
requestArgsThe request arguments.
callbackThe callback to execute on success or failure.

◆ sendText()

abstract fm.liveswitch.HttpResponseArgs fm.liveswitch.HttpTransfer.sendText ( fm.liveswitch.HttpRequestArgs  requestArgs)
abstract

Sends text content synchronously using the specified arguments.

Parameters
requestArgsThe request arguments.
Returns
The response arguments from the server.

◆ sendTextAsync()

abstract void fm.liveswitch.HttpTransfer.sendTextAsync ( fm.liveswitch.HttpRequestArgs  requestArgs,
fm.liveswitch.IAction1< fm.liveswitch.HttpResponseArgs callback 
)
abstract

Sends text content asynchronously using the specified arguments.

Parameters
requestArgsThe request arguments.
callbackThe callback to execute on success or failure.

◆ setWildcardCharacters()

static void fm.liveswitch.HttpTransfer.setWildcardCharacters ( String  value)
static

Sets the wildcard characters used to replace asterisks in ReplaceWildcards.

◆ shutdown()

abstract void fm.liveswitch.HttpTransfer.shutdown ( )
abstract

Releases any resources and shuts down.

Reimplemented in fm.liveswitch.HttpWebRequestTransfer.