HTTP Commands
All SaveToDB products support URLs in the Actions Menu and Context Menu.
Every version of the SaveToDB add-in allows you to use URLs to retrieve data.
SaveToDB 10 supports URLs and complex HTTP commands universally. You can use POST to get data, save changes, retrieve value lists, and more.
- URL Parameters
- Parser Parameters
- HTTP Headers
- HTTP Methods
- Message Body
- Select Queries from HTTP Requests
- Formal Grammar of HTTP Commands
URL Parameters
This section explains how to define URL parameters.
For example, a URL can include a symbol as a segment:
https://some-service/APPL
You can define the parameter name and default value using curly brackets:
https://some-service/{Symbol=APPL}
Here's an example with a standard URL parameter, "s":
https://some-service?s=APPL
The SaveToDB add-in will display this in the ribbon.
To change the parameter name and specify the default value, use curly brackets:
https://some-service?s={Symbol=APPL}
To disable parameters entirely, append {}
at the end of the URL:
https://some-service?s=APPL{}
Parser Parameters
The SaveToDB add-in automatically extracts data from JSON, XML, HTML, CSV, and plain text.
You can customize parser results by applying specific parser parameters.
Add parser parameters after the URL, separating them with semicolons and parameter values with commas.
For example:
https://query1.finance.yahoo.com/v7/finance/options/{Symbol=AAPL};pages=50;rootpath=*.*.*.calls,*.*.*.puts https://www.zohoapis.com/crm/v2/settings/fields?module={module=Accounts};RootPath=fields;ApiResult=true
Supported Parser Parameters
Parameter | Type | Meaning |
---|---|---|
AddRowNum | Boolean | Add a _RowNum column. |
ApiResult | Boolean | Use a special JSON parser for REST API results. |
AsIs | Boolean | Output Yahoo Finance and MSN Money JSON values as is. |
CapitalLetter | Boolean | Capitalize the first letters of headers (JSON only). |
CollapsedNodes | String | Include specified XML nodes in the parent node column. |
FirstRow | Integer | Set the first row of the source data to output. |
FirstRowHasNames | Boolean | Indicate whether the source data has headers. |
IgnoredTags | String | Exclude specified XML tags from column creation. |
InputSeparator | String | Define the CSV input separator. |
KeptNodes | String | Include specified XML or JSON nodes in the output, even if they have no data. |
Pages | Integer | Set the number of pages to load. |
RootPath | String | Define XML nodes, JSON properties, or HTML table numbers to select data. |
SkippedNodes | String | Exclude specified XML nodes or JSON properties from the output. |
HTTP Headers
SaveToDB 10 allows you to set request headers inline.
Add HTTP headers after the URL, separated by a single CR, LF, or CRLF. Use a colon to separate header names and values.
For example:
https://some-service/{Symbol} Accept: application/json Referrer: https://some-service/page
You can also use parameters defined in curly brackets within headers (e.g., to customize the referrer).
HTTP Methods
SaveToDB 10 supports the following HTTP methods: GET, POST, PUT, PATCH, MERGE, and DELETE.
Use these methods when specifying REST API commands to save changes.
Add the method before the URL, separated by a space.
Message Body
SaveToDB 10 supports application/json and application/x-www-form-urlencoded body formats.
It automatically detects the format based on the body definition.
The body can include parameters prefixed with the @
character.
You can manually specify parameters for all properties or use built-in parameters like @json_row_values and @form_row_values, which include all row values.
Separate the body from the URL and headers with two line breaks.
Here's an example of a POST command:
POST https://www.zohoapis.com/crm/v2/Contacts {"data":[{@json_row_values}]}
For more details, see Saving Data Using REST API.
Select Queries from HTTP Requests
SaveToDB 10 supports select queries from HTTP requests.
For instance, you can add a symbol parameter value to output columns like this:
SELECT @Symbol, * FROM https://some-service/{Symbol=APPL}
However, we recommend using the full form with column aliases and square brackets for URLs and HTTP messages:
SELECT @Symbol AS Symbol, * FROM [https://some-service/{Symbol=APPL}]
You can specify required column names and assign new names using aliases. For example:
SELECT @Symbol AS Symbol, d AS Date, l AS Last FROM [https://some-service/{Symbol=APPL}]
You can also use multi-line queries, including WHERE and ORDER BY clauses:
SELECT @Symbol AS Symbol, d AS Date, l AS Last FROM [https://some-service/{Symbol=APPL}] ORDER BY Date
Here's a more complex example:
SELECT @Symbol AS Symbol, d AS Date, l AS Last FROM [POST https://some-service/;ApiResult=true HTTP/1.1 Accept: application/json Referrer: https://some-service/page {"symbol":@symbol} ] ORDER BY Date
Formal Grammar of HTTP Commands
HTTP-command = HTTP-message | select HTTP-message = [ method SP ] request-target [ SP HTTP-version] *( NEWLINE header-name ":" header-value ) [ 2*NEWLINE message-body ] method = "GET" | "POST" | "PUT" | "PATCH" | "MERGE" | "DELETE" request-target = absolute-URI *( ";" parser-parameter-name "=" parser-parameter-value ) HTTP-version = "HTTP/1.1" select = "SELECT" SP select-fields SP "FROM" SP select-source [SP "WHERE" conditions ] [ SP "ORDER BY" orderBy ] select-source = "[" HTTP-message "]" / DQUOTE HTTP-message DQUOTE NEWLINE = CR | LF | CRLF
This grammar extends RFC standards:
- [RFC7230] Fielding, R., Ed. And J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", RFC 7230, June 2014. https://datatracker.ietf.org/doc/html/rfc7230.
- [RFC7231] Fielding, R., Ed. And J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", RFC 7231, June 2014. https://datatracker.ietf.org/doc/html/rfc7231.
- [RFC7232] Fielding, R., Ed. And J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests", RFC 7232, June 2014. https://datatracker.ietf.org/doc/html/rfc7232.