Task - Send Response

This task sends a response back to the client.

Note that this task must be the last in a sequence - no other tasks or locations are processed after this.

Call service / retrieve URL

Description

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

JSON key: description
Default value: Blank

Canned Response

Specify the name of a "canned" response here to reuse it - when set, the response sent back will be the one defined in the canned response - if any other values are specified here, HTTP response code, reason etc. then these values overwrite what was specified in the canned response. Any headers defined will complement the ones specified for the canned response.

Default: none
JSON key: response.name 

HTTP Response code

HTTP Response code to send back to client.

Default: 500
JSON key: response.status 

HTTP Response reason

HTTP response reason text

Default: No additional information
JSON key: response.reason 

Redirect Location

Response Redirect Location URL - if set, a redirect will be sent instead of a normal response, the Location header in the response will be set to this value.

Default: none
JSON key: response.redirect

Content-Type

HTTP Response content-type

Default: none
JSON key: response.contenttype

Response Body

Response body contents

Default: none
JSON key: response.body 

Headers

Response headers can also be added to the response, if any are specified, they are in an JSON array called response.headers within the task JSON object.

HTTP Response headers can be specified in the JSON Property "response.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.

{
  "response.contenttype": "application/json",
  "description": "Write result created by script in previous taks",
  "response.reason": "Language Data",
  "response.status": 200,
  "response.content": "%{requestattribute:result}",
  "response.headers": [{
    "name": "Server",
    "value": "Ceptor"
  }],
  "class": "io.ceptor.pipeline.tasks.SendResponseTask"
}



© Ceptor ApS. All Rights Reserved.