gsqlcmd Web Request Options

gsqlcmd Web Request Options

/accept=<accept>

Use this option to set the Accept header of web requests.

For example:

/accept=application/json;odata=verbose

You can set the default value in the configuration file like

<add key="Accept" value="application/json;odata=verbose"/>

/acceptEncoding=<value>

Use this option to set the AcceptEncoding header of web requests.

For example:

/acceptEncoding=gzip,deflate

/contentType=<contentType>

Use this option to set the ContentType header of web requests.

For example:

/contentType=application/json

See RFC 7231, section 3.1.1.5: Content-Type.

/delay=<milliseconds>

Use this option to set the delay between requests to prevent banning your IP by web servers.

For example, specify 500 milliseconds to make a maximum of two requests per second:

/delay=500

The default value is 200 milliseconds, i.e., five requests per second.

In batch files with a single request in a cycle, use the sleep mode.

/header=<header>

Use this option to add request headers.

For example:

"/header=Authorization: Bearer 12345"

To add several headers, use this option several times.

/method=AUTO | GET | POST | PUT | PATCH | MERGE | DELETE | HEAD

Use this option to specify the web request method: AUTO, GET, POST, PUT, PATCH, MERGE, DELETE, or HEAD.

For example:

gsqlcmd download https://localhost/crm/contacts?id=1 /method=DELETE

The default method is GET. If the /postData option is not empty, the default method is POST.

/pages=<pages>

Use this option to define the number of loaded pages (for example, the number of option chain pages).

For example:

/pages=5

This option works if the utility can detect next page URLs.

/pageNumberDigits=<pageNumberDigits>

Use this option to define the number of digits in the output file page number.

For example:

/pageNumberDigits=2

In this example, if you specify the output file name as AAPL.json, the tool will save downloaded pages as AAPL-01.json, AAPL-02.json, and so on.

/postData=<string> | <file name>

Use this option to define web request data for POST, PUT, PATCH, MERGE, and DELETE methods.

For example:

gsqlcmd download https://localhost/crm/contacts /method=POST /postData=contact.json

The POST method is the default if the /postData option has a value.

/referrer=<Referrer header value>

Use this option to set the Referrer header value of the web request.

For example:

/referrer=https://www.msn.com/en-us/money/

Note that the HTTP header uses an originally misspelled form, "referer".
gsqlcmd accepts both forms: /referer and /referrer.

/timeout=<milliseconds>

Use this option to set the timeout of web requests.

The default timeout is 100 seconds (100 000 ms).

For example:

/timeout=10000

/userAgent=<user agent>

Use this option to set the UserAgent header of web requests.

For example:

"/UserAgent=gsqlcmd 6.0"

You can set the default value in the configuration file like

<add key="UserAgent" value="gsqlcmd 6.0"/>