a!httpResponse() Function

Returns an HTTP Response object for use in a Web API.

Syntax

a!httpResponse( statusCode, headers, body )

  • statusCode (Number(Integer)): The status code of the response. Default is "200" meaning successful completion of the request.

  • headers (List of HttpHeader): A list of headers for the response. Built with a!httpHeader().

  • body (Text): The body of the response.

Returns

HTTP Response

Examples

  a!httpResponse(
    statusCode: 200,
    headers: {
      a!httpHeader(name: "content-type", value: "application/json")
    },
    body: a!toJson(value: local!user)
  )

See also: Web APIs, a!httpheader()

FEEDBACK