Http

Overview

Class to access HTTP urls

Location

  • Reference:
    • Elements.dll  .NET, .NET Standard 2.0
    • elements.jar  Cooper
    • Elements.fx  Island, ToffeeV2
    • libElements.fx  Toffee
  • Namespace: RemObjects.Elements.RTL
  • Platforms: .NET, .NET Standard 2.0, Cooper, Island, Toffee, ToffeeV2

Class Methods


ExecuteRequest

Execute a request and call the callback when it's done.

 

class method ExecuteRequest(aRequest: not nullable HttpRequest; ResponseCallback: not nullable HttpResponseBlock)

 

static void ExecuteRequest(HttpRequest! aRequest, HttpResponseBlock! ResponseCallback)

 

static func ExecuteRequest(_ aRequest: HttpRequest, _ ResponseCallback: HttpResponseBlock)

 

static void ExecuteRequest(HttpRequest aRequest, HttpResponseBlock ResponseCallback)

 

Shared Sub ExecuteRequest(aRequest As HttpRequest, ResponseCallback As HttpResponseBlock)

Parameters:

  • aRequest:
  • ResponseCallback:

ExecuteRequestAndSaveAsFile

Execute a request, saves it to a file and call the callback when it's done.

 

class method ExecuteRequestAndSaveAsFile(aRequest: not nullable HttpRequest; aTargetFile: not nullable File; contentCallback: not nullable HttpContentResponseBlock<File>)

 

static void ExecuteRequestAndSaveAsFile(HttpRequest! aRequest, File! aTargetFile, HttpContentResponseBlock<File>! contentCallback)

 

static func ExecuteRequestAndSaveAsFile(_ aRequest: HttpRequest, _ aTargetFile: File, _ contentCallback: HttpContentResponseBlock<File>)

 

static void ExecuteRequestAndSaveAsFile(HttpRequest aRequest, File aTargetFile, HttpContentResponseBlock<File> contentCallback)

 

Shared Sub ExecuteRequestAndSaveAsFile(aRequest As HttpRequest, aTargetFile As File, contentCallback As HttpContentResponseBlock<File>)

Parameters:

  • aRequest:
  • aTargetFile:
  • contentCallback:

ExecuteRequestAsBinary

Execute a request and call the callback when it's done, treat the response as a binary.

 

class method ExecuteRequestAsBinary(aRequest: not nullable HttpRequest; contentCallback: not nullable HttpContentResponseBlock<ImmutableBinary>)

 

static void ExecuteRequestAsBinary(HttpRequest! aRequest, HttpContentResponseBlock<ImmutableBinary>! contentCallback)

 

static func ExecuteRequestAsBinary(_ aRequest: HttpRequest, _ contentCallback: HttpContentResponseBlock<ImmutableBinary>)

 

static void ExecuteRequestAsBinary(HttpRequest aRequest, HttpContentResponseBlock<ImmutableBinary> contentCallback)

 

Shared Sub ExecuteRequestAsBinary(aRequest As HttpRequest, contentCallback As HttpContentResponseBlock<ImmutableBinary>)

Parameters:

  • aRequest:
  • contentCallback:

ExecuteRequestAsJson

Execute a request and call the callback when it's done, treat the response as a json.

 

class method ExecuteRequestAsJson(aRequest: not nullable HttpRequest; contentCallback: not nullable HttpContentResponseBlock<JsonDocument>)

 

static void ExecuteRequestAsJson(HttpRequest! aRequest, HttpContentResponseBlock<JsonDocument>! contentCallback)

 

static func ExecuteRequestAsJson(_ aRequest: HttpRequest, _ contentCallback: HttpContentResponseBlock<JsonDocument>)

 

static void ExecuteRequestAsJson(HttpRequest aRequest, HttpContentResponseBlock<JsonDocument> contentCallback)

 

Shared Sub ExecuteRequestAsJson(aRequest As HttpRequest, contentCallback As HttpContentResponseBlock<JsonDocument>)

Parameters:

  • aRequest:
  • contentCallback:

ExecuteRequestAsString

Execute a request and call the callback when it's done, treat the response as a string.

 

class method ExecuteRequestAsString(aEncoding: Encoding; aRequest: not nullable HttpRequest; contentCallback: not nullable HttpContentResponseBlock<String>)

 

static void ExecuteRequestAsString(Encoding aEncoding, HttpRequest! aRequest, HttpContentResponseBlock<String>! contentCallback)

 

static func ExecuteRequestAsString(_ aEncoding: Encoding, _ aRequest: HttpRequest, _ contentCallback: HttpContentResponseBlock<String>)

 

static void ExecuteRequestAsString(Encoding aEncoding, HttpRequest aRequest, HttpContentResponseBlock<String> contentCallback)

 

Shared Sub ExecuteRequestAsString(aEncoding As Encoding, aRequest As HttpRequest, contentCallback As HttpContentResponseBlock<String>)

Parameters:

  • aEncoding:
  • aRequest:
  • contentCallback:

ExecuteRequestAsXml

Execute a request and call the callback when it's done, treat the response as xml.

 

class method ExecuteRequestAsXml(aRequest: not nullable HttpRequest; contentCallback: not nullable HttpContentResponseBlock<XmlDocument>)

 

static void ExecuteRequestAsXml(HttpRequest! aRequest, HttpContentResponseBlock<XmlDocument>! contentCallback)

 

static func ExecuteRequestAsXml(_ aRequest: HttpRequest, _ contentCallback: HttpContentResponseBlock<XmlDocument>)

 

static void ExecuteRequestAsXml(HttpRequest aRequest, HttpContentResponseBlock<XmlDocument> contentCallback)

 

Shared Sub ExecuteRequestAsXml(aRequest As HttpRequest, contentCallback As HttpContentResponseBlock<XmlDocument>)

Parameters:

  • aRequest:
  • contentCallback:

ExecuteRequestSynchronous

Execute a request and blocks until the response is available.

 

class method ExecuteRequestSynchronous(aRequest: not nullable HttpRequest): not nullable HttpResponse

 

static HttpResponse! ExecuteRequestSynchronous(HttpRequest! aRequest)

 

static func ExecuteRequestSynchronous(_ aRequest: HttpRequest) -> HttpResponse

 

static HttpResponse ExecuteRequestSynchronous(HttpRequest aRequest)

 

Shared Function ExecuteRequestSynchronous(aRequest As HttpRequest) As HttpResponse

Parameters:

  • aRequest:

GetBinary

Returns the response for a give request as binary.

 

class method GetBinary(aRequest: not nullable HttpRequest): not nullable ImmutableBinary

 

static ImmutableBinary! GetBinary(HttpRequest! aRequest)

 

static func GetBinary(_ aRequest: HttpRequest) -> ImmutableBinary

 

static ImmutableBinary GetBinary(HttpRequest aRequest)

 

Shared Function GetBinary(aRequest As HttpRequest) As ImmutableBinary

Parameters:

  • aRequest:

GetJson

Returns the response for a give request as json.

 

class method GetJson(aRequest: not nullable HttpRequest): not nullable JsonDocument

 

static JsonDocument! GetJson(HttpRequest! aRequest)

 

static func GetJson(_ aRequest: HttpRequest) -> JsonDocument

 

static JsonDocument GetJson(HttpRequest aRequest)

 

Shared Function GetJson(aRequest As HttpRequest) As JsonDocument

Parameters:

  • aRequest:

GetString

Returns the response for a give request as string.

 

class method GetString(aEncoding: Encoding; aRequest: not nullable HttpRequest): not nullable String

 

static String! GetString(Encoding aEncoding, HttpRequest! aRequest)

 

static func GetString(_ aEncoding: Encoding, _ aRequest: HttpRequest) -> String

 

static String GetString(Encoding aEncoding, HttpRequest aRequest)

 

Shared Function GetString(aEncoding As Encoding, aRequest As HttpRequest) As String

Parameters:

  • aEncoding:
  • aRequest:

GetXml

Returns the response for a give request as xml.

 

class method GetXml(aRequest: not nullable HttpRequest): not nullable XmlDocument

 

static XmlDocument! GetXml(HttpRequest! aRequest)

 

static func GetXml(_ aRequest: HttpRequest) -> XmlDocument

 

static XmlDocument GetXml(HttpRequest aRequest)

 

Shared Function GetXml(aRequest As HttpRequest) As XmlDocument

Parameters:

  • aRequest:

initialize ToffeeV2

 

static func initialize()

initialize initialize() Toffee

 

static func initialize(initialize )

Parameters:

  • :

TryExecuteRequestSynchronous

Try execute a request, blocking, returns null on failure.

 

class method TryExecuteRequestSynchronous(aRequest: not nullable HttpRequest): nullable HttpResponse

 

static HttpResponse? TryExecuteRequestSynchronous(HttpRequest! aRequest)

 

// Toffee
static func TryExecuteRequestSynchronous(_ aRequest: HttpRequest) -> HttpResponse
// ToffeeV2
static func TryExecuteRequestSynchronous(_ aRequest: HttpRequest) -> HttpResponse?

 

static HttpResponse TryExecuteRequestSynchronous(HttpRequest aRequest)

 

Shared Function TryExecuteRequestSynchronous(aRequest As HttpRequest) As HttpResponse?

Parameters:

  • aRequest:

TryGetJson

Returns the response for a give request as json or null on failure.

 

class method TryGetJson(aRequest: not nullable HttpRequest): nullable JsonDocument

 

static JsonDocument? TryGetJson(HttpRequest! aRequest)

 

// Toffee
static func TryGetJson(_ aRequest: HttpRequest) -> JsonDocument
// ToffeeV2
static func TryGetJson(_ aRequest: HttpRequest) -> JsonDocument?

 

static JsonDocument TryGetJson(HttpRequest aRequest)

 

Shared Function TryGetJson(aRequest As HttpRequest) As JsonDocument?

Parameters:

  • aRequest:

TryGetXml

Returns the response for a give request as xml or null on failure.

 

class method TryGetXml(aRequest: not nullable HttpRequest): nullable XmlDocument

 

static XmlDocument? TryGetXml(HttpRequest! aRequest)

 

// Toffee
static func TryGetXml(_ aRequest: HttpRequest) -> XmlDocument
// ToffeeV2
static func TryGetXml(_ aRequest: HttpRequest) -> XmlDocument?

 

static XmlDocument TryGetXml(HttpRequest aRequest)

 

Shared Function TryGetXml(aRequest As HttpRequest) As XmlDocument?

Parameters:

  • aRequest: