Ifurltransfer – BrightSign Object Reference Manual (FW 5.1) User Manual

Page 250

Advertising
background image

242

GetPort() As Object

The ifUrlTransfer interface provides the following:

SetUrl(URL As String) As Boolean: Sets the URL for the transfer request. This function returns False on
failure. Use GetFailureReason to learn the reason for the failure.

Note
When using

SetUrl to retrieve content from local storage, you do not need to specify the full file path:

SetUrl("file:/example.html"). If the content is located somewhere other than the current storage device, you
can specify it within the string itself. For example, you can use the following syntax to retrieve content from a storage
device inserted into the USB port when the current device is an SD card:
SetUrl("file:///USB1:/example.html").

AddHeader(name As String, value As String) As Boolean: Adds the specified HTTP header. This is
only valid for HTTP URLs. This function returns False on failure. Use

GetFailureReason() to learn the reason

for the failure.

GetToString As String: Connects to the remote service as specified in the URL and returns the response
body as a string. This function cannot return until the exchange is complete, and it may block for a long time.
Having a single string return means that much of the information (headers, response codes) has been discarded. If
you need this information, you can use

AsyncGetToString() instead.

Note: The size of the returned string is limited to 65,536 characters.

GetToFile(filename As String) As Integer: Connects to the remote service as specified in the URL and
writes the response body to the specified file. This function does not return until the exchange is complete and may
block for a long time. The response code from the server is returned. It is not possible to access any of the
response headers. If you need this information, use

AsyncGetToFile() instead.

Advertising