Rourltransfer (hd2000 only) – BrightSign HD2000 Object Reference Manual User Manual

Page 48

Advertising
background image

roUrlTransfer (HD2000 only)

This object is used for reading from and writing to remote servers through URLs.

This object is created with no parameters:
 CreateObject("roUrlTransfer")

The interface provides:
 rotINT32 GetIdentity()

o

Returns a magic number that can be used to identify whether events originated from this

object.

 rotBOOL SetUrl(rotSTRING URL)

o

Sets the URL to use for the transfer request.

o

Returns false on failure – use GetFailureReason() to find out the reason for the failure.

 rotVOID SetPort(ifMessagePort port)

o

Set the message port to which events will be posted for asynchronous requests.

 rotBOOL AddHeader(rotSTRING name, rotSTRING value)

o

Add the specified HTTP header. Only valid for HTTP URLs.

o

Returns false on failure – use GetFailureReason() to find out the reason for the failure.

 rotSTRING GetToString(rotVOID)

o

Connect to the remote service as specified in the URL and return the response body as a

string. This function cannot return until the exchange is complete and it may block for a long
time.

o

Only having a single string return means that much of the information (headers, response

codes) is discarded. If this information is required then use AsyncGetToString instead.

o

The size of string returned is limited to 65536 characters.

 rotINT32 GetToFile(rotSTRING filename)

o

Connect to the remote service as specified in the URL and write the response body to the

specified file.

o

This function does not return until the exchange is complete and may block for a long time.

o

The response code from the server is returned. It is not possible to access any of the response

headers. If this information is required use AsyncGetToFile instead.

 rotBOOL AsyncGetToString(rotVOID)

o

Begin a get request to a string asynchronously. Events will be sent to the message port

associated with the object. If false is returned then the request could not be issued and no
events will be delivered.

 rotBOOL AsyncGetToFile(rotSTRING filename)

o

Begin a get request to a file asynchronously. Events will be sent to the message port

associated with the object. If false is returned then the request could not be issued and no
events will be delivered.

 roUrlEvent Head(rotVOID)

o

Synchronously perform an HTTP HEAD request and return the resulting response code and

headers through a roUrlEvent object. In the event of catastrophic failure (e.g. an asynchronous
operation is already active) then a null object is returned.

 rotBOOL AsyncHead(rotVOID)

o

Begin an HTTP HEAD request asynchronously. Events will be sent to the message port

associated with the object. If false is returned then the request could not be issued and no
events will be delivered.

 rotINT32 PostFromString(rotSTRING request)

o

Use the HTTP POST method to post the supplied string to the current URL and return the

response code. Any response body is discarded.

 rotBOOL PostFromFile(rotSTRING filename)

o

Use the HTTP POST method to post the contents of the file specified to the current URL and

return the response code. Any response body is discarded.

48

Advertising
This manual is related to the following products: