HTTP Request

 Show all Hide all

Makes a request to a server using HTTP/HTTPS and passes the result to the database. The component is mostly used for lightweight integrations, for example periodically fetching a CSV file from a web server.

Uses proxy settings defined in application variables PROXY and PROXYBYPASSLOCAL to make the request.

The component requires that any text it downloads is encoded in either UTF-8 or ASCII.

Component modes: Single | Batch

Component mode: Single

Component settings

Request timeout
Timeout in seconds for the HTTP request. Leave blank to use default (20 minutes).

SQL

SQL Call: Specify request (mandatory)

SQL-statement that retrieves the url, method and parameters for the request.

May modify database: No

Parameters:

@Request bit
Set when the server requests method, url and parameters for the request.

Resultset: Request

Repeat mode: repeated exactly once
Row count: exactly one row

Columns:

FormEncoding optional string
Determines how posted data is encoded. This column is only allowed if the Method is specified as POST.
Default: "multipart/form-data" is the default.
Possible value Description
application/x-www-form-urlencoded Parameter names and values are escaped: non alphanumeric characters are replaced by %HH (two hex digits ASCII code). Not efficient for large quantities of non alphanumeric data.
Parameters with Filename are not allowed.
multipart/form-data Accepts text data, binary data and files.
Method optional string
The HTTP method to use.
Default: GET is the default method used.
Possible value Description
GET Performs an HTTP GET request. Parameters are supplied via the query string.
POST Performs an HTTP POST request. Parameters are supplied as form data (mime-type: multipart/form-data)
Url mandatory string
The url of the request. (including http:// or https://).

Resultset: Headers (optional)

Custom HTTP-headers to pass with the request.
Repeat mode: repeated zero or one time
Row count: zero or more rows

Columns:

HttpHeaderName mandatory string
Name of the custom HTTP header.

You should not pass standard HTTP headers like Content-Type or Accept-Encoding as doing so may interfere with the component and may break in future versions.
HttpHeaderValue optional string
The value to pass. If NULL then the header will be omitted.

Resultset: Parameters (optional)

The parameters to supply with the request.
Repeat mode: repeated zero or one time
Row count: exactly one row

Columns:

<xxx> optional string
A parameter to supply with the request. The way these are passed depends on the method specified. For a GET request they passed on the querystring, for POST requests they passed as form parameters. Currently form data is always posted as 'multipart/form-data'.
<xxx>ContentType optional string
Used to specify the content type of the parameter. Only relevant for POST requests. Default is 'application/octet-stream' for binary data and 'text/plain' for all other data.
<xxx>Filename optional string
Used to specify the filename of the parameter . Only relevant for POST requests. Setting this flags also sets 'Content-Disposition' to 'attachment'.

SQL Call: Store response (mandatory)

SQL statement that passes the data retrieved from the server to the database.

If the Content-Type of the data received from the server is a text type (any type that starts with "text/", for example text/plain, text/csv, text/html) then the response will be passed through the @TextResponse parameter. Otherwise it will be passed through the @ImageResponse parameter.

May modify database: Yes

Parameters:

@ContentType string
Set to the Content-Type field of the HTTP response.
@Disposition string
Set to the Content-Disposition field of the HTTP response. (The filename part is passed separately).
@Filename string
Set to the filename supplied if disposition is 'attachment'.
@ImageResponse binary
Binary data returned by server. ADMIN_Force can not be used when this parameter is set.
@TextResponse string
Text data returned from the server.

Resultset: Forwarding definitions

Repeat mode:
Row count:

Columns:

<querystring_variable> optional string
Any column with no other specific meaning will pe passed along on the querystring to the menuitem you are forwarding to.
ADMIN_CancelCidStepsBack optional int
Number of steps in the page history to jump back if the user clicks OK in an ADMIN_MESSAGE dialog or Cancel in an ADMIN_FORCE dialog (the default being none). This value overrides cancelcidstepsback specified in the query string.
ADMIN_CancelMenuItem optional string
Alias of the menuitem to execute if the user clicks OK in an ADMIN_MESSAGE dialog or Cancel in an ADMIN_FORCE dialog (the default being none). This value overrides cancelmenuitemid specified in the query string.
ADMIN_CancelMenuItemId optional int
Deprecated. Use ADMIN_CancelMenuItem instead.

Id of the menuitem to execute if the user clicks OK in an ADMIN_MESSAGE dialog or Cancel in an ADMIN_FORCE dialog (the default being none). This value overrides cancelmenuitemid specified in the query string.
ADMIN_CidStepsBack optional int
Number of steps in the page history to jump back after execution (the default being one step back). This value overrides any destination specified by the query string.
ADMIN_Force optional string
Prompts the user with the specified text and the user may answer OK or cancel. If the user chooses OK the sql call will be rerun with the parameter @force set to 1.
ADMIN_Forward optional string
Displays a user friendly message and then forwards to the next menu item.
ADMIN_ForwardMenuGroupId optional int
Id of the menu group to show after execution (instead of former menu item). This value overrides any destination specified by the query string.
ADMIN_ForwardMenuItem optional string
Alias of the menuitem to execute after execution (instead of former menu item). This value overrides any destination specified by the query string.
ADMIN_ForwardMenuItemId optional int
Deprecated. Use ADMIN_ForwardMenuItem instead.

Id of the menuitem to execute after execution (instead of former menu item). This value overrides any destination specified by the query string.
ADMIN_Message optional string
Displays a user friendly message to the user.
ADMIN_PasteHtmlFromPopup optional string
Pastes HTML. See admin_setfieldvaluefrompopup
ADMIN_SetFieldValueFromPopup optional string
Sets the value of field specified in the menuitempopup call. Only select this column if menuitem is opened in popup.
ADMIN_ClosePopup optional bit
If this column is anything but NULL the popup will be closed. Only select this column if the menuitem is opened in popup.
Default: The default behavior is to step back inside the popup window and close it if there is nothing to step back to.
ADMIN_Unselect optional bit
Alias for ADMIN_UnselectAll.
ADMIN_UnselectAll optional bit
If this column is anything but NULL all items are removed from the list of selected items.
Default: By default selected items are maintained when you return to the grid/calendar. This applies even if the selected item is no longer visible in the component unless this column is specified.
Cache optional string
Cache key to be cleared. Supports wildcards.
CacheUserId optional string
Either a user id or '%'.

Clears all caches (e.g. access permissions) related to the specified user id.

Use '%' to clear caches for all users.
CancelButtonText optional string
Changes the text of the Cancel button when used with ADMIN_Force.
OkButtonText optional string
Changes the text of the OK button when used with ADMIN_Message, ADMIN_Force, or ADMIN_Forward.

SQL Call: Forwarding details (mandatory)

Call made to determine where to forward to. This call is only made if the "Specify Request"-call does not return any requests.

May modify database: No

Parameters:

@forward bit
Set to 1 when requesting forwarding details.

Resultset: Forwarding definitions (optional)

Repeat mode: repeated zero or more times
Row count: exactly one row

Columns:

<querystring_variable> optional string
Any column with no other specific meaning will pe passed along on the querystring to the menuitem you are forwarding to.
ADMIN_CancelCidStepsBack optional int
Number of steps in the page history to jump back if the user clicks OK in an ADMIN_MESSAGE dialog or Cancel in an ADMIN_FORCE dialog (the default being none). This value overrides cancelcidstepsback specified in the query string.
ADMIN_CancelMenuItem optional string
Alias of the menuitem to execute if the user clicks OK in an ADMIN_MESSAGE dialog or Cancel in an ADMIN_FORCE dialog (the default being none). This value overrides cancelmenuitemid specified in the query string.
ADMIN_CancelMenuItemId optional int
Deprecated. Use ADMIN_CancelMenuItem instead.

Id of the menuitem to execute if the user clicks OK in an ADMIN_MESSAGE dialog or Cancel in an ADMIN_FORCE dialog (the default being none). This value overrides cancelmenuitemid specified in the query string.
ADMIN_CidStepsBack optional int
Number of steps in the page history to jump back after execution (the default being one step back). This value overrides any destination specified by the query string.
ADMIN_Force optional string
Prompts the user with the specified text and the user may answer OK or cancel. If the user chooses OK the sql call will be rerun with the parameter @force set to 1.
ADMIN_Forward optional string
Displays a user friendly message and then forwards to the next menu item.
ADMIN_ForwardMenuGroupId optional int
Id of the menu group to show after execution (instead of former menu item). This value overrides any destination specified by the query string.
ADMIN_ForwardMenuItem optional string
Alias of the menuitem to execute after execution (instead of former menu item). This value overrides any destination specified by the query string.
ADMIN_ForwardMenuItemId optional int
Deprecated. Use ADMIN_ForwardMenuItem instead.

Id of the menuitem to execute after execution (instead of former menu item). This value overrides any destination specified by the query string.
ADMIN_Message optional string
Displays a user friendly message to the user.
ADMIN_PasteHtmlFromPopup optional string
Pastes HTML. See admin_setfieldvaluefrompopup
ADMIN_SetFieldValueFromPopup optional string
Sets the value of field specified in the menuitempopup call. Only select this column if menuitem is opened in popup.
ADMIN_ClosePopup optional bit
If this column is anything but NULL the popup will be closed. Only select this column if the menuitem is opened in popup.
Default: The default behavior is to step back inside the popup window and close it if there is nothing to step back to.
Cache optional string
Cache key to be cleared. Supports wildcards.
CacheUserId optional string
Either a user id or '%'.

Clears all caches (e.g. access permissions) related to the specified user id.

Use '%' to clear caches for all users.
CancelButtonText optional string
Changes the text of the Cancel button when used with ADMIN_Force.
OkButtonText optional string
Changes the text of the OK button when used with ADMIN_Message, ADMIN_Force, or ADMIN_Forward.

SQL Call: Validate parameters

Allows you to validate the parameters supplied by the user before any other SQL is run in the component. This call is only made if the component has visible parameters, the SQL is a stored procedure, and 'Validate parameters' is checked.

May modify database: No

Parameters:

@Force bit
Set to 1 if the last call to validate parameters used admin_force and the user clicked OK in the OK/Cancel dialog.
@ValidateParams bit
Set to 1 when this call is made.

Custom access control and logging

SQL Call: Custom access control and logging

Use this call to restrict which entries a user is allowed to view and edit, and to log which entries a user views.

Access to a menu item is normally controlled through functions and roles alone but some entities need more fine grained control. For example, a user may have access to the View Member menu item for normal members but not for members with a protected identity.

The menu items a user visits are always logged (in ADMINLogMenuItem) but for sensitive data you may need to log exactly what entries are viewed. Do the logging in this call as the common ways of viewing data (grid and InfoSQL) are not allowed to modify the database.

If you bind a scalar function instead of a stored procedure to this call then its name must end with '_GrantAccess'.

May modify database: Yes

Resultset: Access permissions

Return whether the user is allowed to visit the menu item with the current parameters.
Repeat mode: repeated exactly once
Row count: exactly one row

Columns:

GrantAccess mandatory bit
1 if the user is allowed to view the menu item, 0 if the user should not be allowed to view the menu item.

If 0 then an error will be logged as the user should not have been able to reach the menu item with the given parameters in the first place.

Examples

Simple file download

Downloads a file and saves it to the database.

CREATE OR ALTER PROCEDURE dbo.FetchOpenIdConfiguration
	@Request       bit = 0,
	@ContentType   varchar(1000) = NULL,
	@ImageResponse varbinary(max) = NULL
AS
BEGIN
	IF @Request = 1
	BEGIN
		SELECT 'https://login.microsoftonline.com/common/.well-known/openid-configuration' AS Url;
		RETURN;
	END;

	IF @ImageResponse IS NOT NULL
	BEGIN
		INSERT dbo.Download (FileData, FileContentType)
		VALUES (@ImageResponse, @ContentType);
		RETURN;
	END;
END;