Skip to content

Request

Miriam McMahon edited this page Feb 15, 2023 · 10 revisions

Send an HTTP request

Parameters

Parameter Name Description Type Expression/Variable Required
RequestObjectName The name of the variable that contains the HTTP request object String Not Permitted Yes
ResponseObjectName An option variable name; the response to the request will be stored in this variable if present String Not Permitted No
Verb The HTTP verb for the request (e.g. Get, Post, Put, Delete) String Not Permitted Yes
Url The URL of the request String Permitted Yes
SubstitutionInUrl Whether to perform variable substitution and inline-expression parsing on the Url property, defaults to false Boolean Not Permitted No
Content The request body content as an object. Defaults to empty. See below for the structure of this property. object n/a No
IgnoreServerCertAuthentication If true, skip validation of the remote server's HTTPS certificate. Strongly recommend only using this in testing. Defaults to false. Boolean Permitted No
AllowRedirect If true, the client will automatically follow redirects sent in the response. Defaults to true. Boolean Not Permitted No
PersistCookies If true, cookies will persist from this to future requests. If false, any cookies returned in the response to this request will immediately be forgotten. Defaults to true. Boolean Not Permitted No
IsSecret Prevent logging of all request and response data. Defaults to false. Boolean Not Permitted No
UrlIsSecret Prevent logging of the URL if it contains sensitive data. Added in V7.2 Boolean Not Permitted No
ProxyIp The Ip address or hostname of a web proxy to use for this connection. Added in V7.2 String Permitted No
ProxyPort The port number of the web proxy to connect to. Added in V7.2 String Permitted No
ProxyUser The user to authenticate to the web proxy. Added in V7.2 String Permitted No
ProxyPassword The password to authenticate the web proxy user. Added in V7.2 String Permitted No

Content

The content property of the Request is used to set a body for the request. The content is made up of a content-type value, and the source (the name of a variable) of the actual content. The content may be any data-type, and will be converted to a string before being used in the Request.

Parameter Name Description Required
ContentObjectName The name of the variable that holds the request content Yes
ContentType The MIME content type, for example "text/plain", or "application/json" Yes

Examples

{
    "Request": {
        "RequestObjectName": "LoginRequest",
        "Verb": "Post",
        "Url": "https://example.com/login",
        "Content" : {
          "ContentType": "application/json",
          "ContentObjectName": "UserLoginObject"
        },
        "ResponseObjectName": "LoginResponse"
    }
}
{
    "Request": {
        "RequestObjectName": "GetStatusRequest",
        "Verb": "Get",
        "Url": "https://example.com/service-status",
        "ResponseObjectName": "StatusResponse"
    }
}

Compatibility

This command was introduced in Safeguard 2.8