Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter TwelveInternet Functions (continued)

HTTPOpenConnection Function

Overview

The HTTPOpenConnection function sets up the HTTP protocol for a connection to a remote server for multiple transactions.

Syntax/Parameters

Syntax

handle = HTTPOpenConnection ( string uri, [dword flags] );

Parameters

uri

A string as a valid URI which must contain the scheme HTTP or HTTPS. The URI can contain query information but cannot contain multi-part requests (POST type HTTP). The path, query and any ID information is ignored.

flags

An optional dword specifying a set of flags on how to process HTTP transactions. See Remarks.

Return Value

A handle for the HTTP connection or NULL_HANDLE on failure. Use the GetLastError and GetLastErrorMessage functions to retrieve additional details. Close the handle to release the connection.

Remarks

Many HTTP functions can be called asynchronously without a handle. In such a case, the connection is opened and closed on each call. Using a connection handle reduces overhead from call to call to the same server by maintaining session information.

Aside from certain syntactical aspects, the domain address is not tested and can point to an invalid or unknown location. An error will not be returned until an HTTP get or post operation is performed. This function should not be used to test for the ability to access a web server.

When the handle is used, the supplied uri authority and security type must match the uri used during the connection process.

The flags can specify two optional parameters:

HTTP_NO_CACHE — Files will not be cached. Each request will be directed to the server.

HTTP_NO_COOKIES — Cookie exchange will be blocked both on request and as send from the server.

The flags will apply to all HTTP transactions performed using the returned connection handle.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic