Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This task calls a remote server to make a service call or retrieve an URL.

Image Added

Call service / retrieve URL

Description

Contains a description of the task, enter the reason for its existence here.

JSON key: description
Default value: Blank

Destination

Destination to send request to, or leave blank to connect directly to URL without using a destination. Please note that connections are pooled and reused when using a destination, also specific HTTPS settings and HTTP/2 can be used.

JSON key: destination
Default value: Blank

Method

HTTP Request method to use when making the call.

JSON key: method
Default value: GET

URI

Please enter the URI, or complete URL in case destination is not used.

JSON key: uri
Default value: None

Body

Enter the request body contents - see Scripts and Macros for details on how to specify macro content.

JSON key: body
Default value: None

Completed attr name

Name of "completed requests" attribute to store result of service call within. This result is stored within the context for the currently executing request.

Info

See Plugins for a list of the contents of the completed requests structure - you can access this either by a script, or by using a macro

JSON key: completed.name
Default: None

Timeout

Timeout in seconds - maximum time to give the server to respond - if not specified, the default settings for the destination will be used. If no destination is set, the timeout will be 30 seconds.

JSON key: timeout
Default value: None

Max retries

If a destination is selected, this is the max number of attempts used to find a working server.

JSON key: retry.count
Default value: 1

Headers

Image Added

HTTP Request headers can be specified in the JSON Property "request.headers", exactly like HTTP headers are configured for Locations.

Do this by selecting the item "Headers" in the sub-tree, where you can add, remove or edit header content. For each header value, You can use Scripts and Macros to produce it.

JSON Configuration

Below is a set of example configuration.

Code Block
languagejs
{
  "completed.name": "lang_da",
  "request.headers": [{
    "name": "Accept",
    "value": "application/json"
  }],
  "method": "GET",
  "body": null,
  "destination": "restcountries.eu",
  "description": "Get information for countries speaking danish",
  "class": "io.ceptor.pipeline.tasks.RetrieveURLTask",
  "uri": "https://restcountries.eu/rest/v2/lang/da"
}