Skip to main content
An HTTP request containing application/x-www-form-urlencoded, text, and binary data.

Properties

NameTypeDescription
UrlstringThe resource URL.
MethodstringThe request type (such as GET or POST).
AuthTokenstringAuthentication token (if external service authentication is required).
AuthSchemestringAuthentication scheme.
ThrowExceptionOnFailedbooleanSpecifies whether an exception should be generated when the external service returns an error code as the HTTP response status (i.e. outside of the 200-299 range). If set to False, exceptions are not generated when an external service returns an error code as the HTTP response status. To view the status of the HTTP response code, check the value of the Status property. Set to True by default. Important! If the response contains an error code, this implies that the external service is working condition and is sending responses to requests. If an error related to service availability or internet connection status occurs when sending an HTTP request, a program exception will be generated regardless of the value of this property, because in this case no external service HTTP status code is provided.
TimeoutnumberRequest timeout in minutes. Set to 1 minute by default. Important! The request timeout value cannot be greater than the script runtime restriction (600 seconds).
ResponseTextstring, read-onlyThe response results in text format.
ResponseTypestring, read-onlyThe type of request response returned by the service, e.g. “application/json”.
StatusnumberThe external service HTTP response status code. If ThrowExceptionOnFailed is set to True, an error code will generate an exception and the transaction will be interrupted. The error message text can be viewed in Skill Monitor.

Methods

NameDescription
SetHeader(string name, string value);Sets additional HTTP headers for the request. This method should be called for each header name.
Send();Sends the HTTP request.
SetFileContent(DocumentExportResult documentExportResult, string mediaType?);Initializes a flow-based HTTP request, allowing exported data to be passed as a file. The type of content being passed is set automatically based on the extension of the exported file, for example, application/json, application/pdf. If required, the content type can be set in advance using the mediaType optional parameter.
SetFileContent(BinaryFile binaryFile, string mediaType?);Initializes a binary data-based HTTP request, passing either the source image file imported when the transaction was created, or the image contained in the field of type Picture. The type of content being passed is set automatically based on the extension of the imported file. If required, the content type can be set in advance using the mediaType optional parameter.
SetSourceFileContent(string mediaType?);Initializes a binary data-based HTTP request, allowing the source image file imported when the transaction was created to be passed. The type of content being passed is set automatically based on the extension of the imported file. If required, the content type can be set in advance using the mediaType optional parameter. Important! This method is deprecated. It will have access only to the first file of the transaction. You should use the SetFileContent() method instead.
SetStringContent(string content, ContentEncoding contentEncoding?, string mediaType?);Initializes a string-based HTTP request. By default Content-Type is set to application/json in UTF8 encoding. If required, you can change both the content and encoding types.
SetUrlFormEncodedContent(any content);Initializes content for a JavaScript object-based request and encodes it as application/x-www-form-urlencoded. The JavaScript object should be initialized as a simple set of property values, e.g.: var form = {}; form.grant_type = "password"; form.scope = "openid permissions"; form.client_id = "value of client_id"; form.client_secret = "value of client_secret"; form.password = "Password"; form.username = "User Name"; request.SetUrlFormEncodedContent(form);