Skip to content

Request

Miriam McMahon edited this page Sep 27, 2023 · 10 revisions

Description

Send an HTTP request to the remote asset

Parameters

Parameter Name Description Type Resolved Type Required
RequestObjectName The name of the variable that contains the HTTP request object String String Yes
ResponseObjectName An option variable name; the response to the request will be stored in this variable if present String String No
Verb (< Safeguard V7.3) The HTTP verb for the request. The supported verbs are: Get, Put, Delete, Post String String Yes
Verb (>= Safeguard V7.3) The HTTP verb for the request. The supported verbs are: Get, Put, Delete, Post, Patch, Head, Options, Trace Value String Yes
Url The URL of the request Value String Yes
SubstitutionInUrl Whether to perform variable substitution and inline-expression parsing on the Url property, defaults to false Boolean Boolean No
Content The request body content as an object. See below for the structure of this property. Default=empty. Value object No
IgnoreServerCertAuthentication If true, skip validation of the remote server's HTTPS certificate. Strongly recommend only using this in testing. Default=false. Value Boolean No
AllowRedirect If true, the client will automatically follow redirects sent in the response. Default= true. Boolean Boolean 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. Default= true. Boolean Boolean No
IsSecret Prevent logging of all request and response data. Default=false. Boolean Boolean No
UrlIsSecret Prevent logging of the URL if it contains sensitive data. Added in Safeguard V7.2 Boolean Boolean No
ProxyIp The Ip address or hostname of a web proxy to use for this connection. Added in Safeguard V7.2 Value String No
ProxyPort The port number of the web proxy to connect to. Added in Safeguard V7.2 Value String No
ProxyUser The user to authenticate to the web proxy. Added in Safeguard V7.2 String Value No
ProxyPassword The password to authenticate the web proxy user. Added in Safeguard V7.2 Value String No

Types

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

Compatibility

This command was introduced in Safeguard 2.8

Examples

Example: Send a Post request with content set to the object 'UseLoginObject'

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

Example: Send a Get request

{
    "Request": {
        "RequestObjectName": "GetStatusRequest",
        "Verb": "Get",
        "Url": "https://example.com/service-status",
        "ResponseObjectName": "StatusResponse"
    }
}