Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter TwelveInternet Functions (continued)

HTTPSetUserAgent Function

Overview

The HTTPSetUserAgent function sets the default user agent for making HTTP requests.

Syntax/Parameters

Syntax

int = HTTPSetUserAgent ( string data );

Parameters

data

A string up to 256 characters specifying the new user agent string.

Return Value

An int as ERROR_NONE or a formatted error code on failure.

Remarks

If an internet object is not open, the default open will be opened. There are no exposed API functions to control or close the internet object.

A user agent string identifies the client (Legato or the hosting application) to a web server when an HTTP request is made. The user agent is set as part of the HTTP header and can can change the behavior of a remote server’s response.

The default Windows 10/11 user agent is normally:

Mozilla/5.0 (compatible; <AppVersion>; <OSVersion>)

The default string makes Legato or the host application look like a browser.

If crawling or scraping web pages, some sites may require (request) that you identify as a bot.

Related Functions

Platform Support

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

Legato IDE, Legato Basic

Page revised 2024-12-13