Web Request Options

Web Request Options

/accept=<accept>

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

For example:

/accept=application/json;odata=verbose

/auth=Default|Basic|Windows|Forms|OAuth1|OAuth2

Use this option to define the authentication method: Default, Basic, Windows, Forms, OAuth1, or OAuth2.

For example:

gsqlcmd download https://localhost/crm/contacts /auth=Forms /username=user /password=pass

You may try to omit the authentication method specifying a user name and password only like

gsqlcmd download https://localhost/crm/contacts /username=user /password=pass

In this case, gsqlcmd tries to detect the appropriate method automatically.

To force using the OAuth1 method, specify the clientId and clientSecret options like

gsqlcmd download https://website.com/api/get-quotes /clientId=myapp /clientSecret=mypassword

/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 a 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.

/password=<password>

Use this option to set a password for protected web resources.

For example:

gsqlcmd download https://localhost/crm/contacts /auth=Forms /username=user /password=pass

/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 a default if the /postData option has a value.

/referer=<Referer header value>

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

For example:

/Referer=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 5.0"

/username=<username>

Use this option to set a username for protected web resources.

For example:

gsqlcmd download https://localhost/crm/contacts /username=user /password=pass

If the tool cannot get data using the credentials, try to specify the authentication method using the /auth option manually like

gsqlcmd download https://localhost/crm/contacts /auth=Forms /username=user /password=pass
This website is using cookies. By continuing to browse, you give us your consent to our use of cookies as explained in our Cookie Policy.