Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter TwelveInternet Functions (continued)

HTTPGetString Function

Overview

The HTTPGetString function retrieves data from a specified URI and places it into a string.

Syntax/Parameters

Syntax

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

Parameters

hHTTP

An optional handle specifying an existing HTTP connection to employ for the transaction. If a handle is used, the HTTP type and authority (domain) must match for the supplied uri parameter.

uri

A string containing a valid URI or path/query. If no handle is supplied, it must contain a full URI with a scheme HTTP or HTTPS. The URI can contain query information but cannot contain multi-part requests (POST type HTTP).

flags

An optional dword which specifies flags and options. The options can be ORed together using the bitwise OR ‘|’ operator. See Remarks below.

Return Value

A string containing the requested data. On error the string will be empty. Use the GetLastError function to get the formatted error code or the HTTP response code. The normal response code is 200 for success (or ‘OK’),

Note that a ‘not found’ or bad URI may still return string data and may not set an error in the response code. In many cases the ISP may return a search page or other link information with a successful status code.

Remarks

The HTTPGetString function uses the HTTP ‘GET’ method which means if the server expects a ‘POST’ the function will not operate properly.

This function is not meant to access binary data and the content will be truncated at the first /0 byte in the sequence. Use the HTTPGetFile function to retrieve binary data.

Using a connection handle speeds operation if multiple requests are to be made to the same authority and domain.

The port used will be either be 80 or 443 and is automatically determined based on the scheme (http or https) used in the uri parameter or for the connection handle.

The flags parameter allows the specification of the following bitwise options:

HTTP_GET_FILE_NO_CACHE — When set to indicates that internal cache should be flushed for the specified URI.

HTTP_GET_FILE_NO_PROGRESS — When set, if a progress display window is open, it will not be updated for status. HTTP functions by default will update status on the second line of the progress window.

Related Functions

Platform Support

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

Legato IDE, Legato Basic

Page revised 2024-12-13