This event is triggered whenever an HTTP or HTTPS request is made to a URL beginning https://your_database/anon/

 

When this happens, a Request biskit is created that captures information about the HTTP request, then any workflow event matching will be triggered. You may then use the properties stored in the event to respond to the particular URLs that you want to. If there is no suitable event configured for a particular URL, then the caller will receive a 501 (Not implemented) status response.

Event Properties

As well as the standard properties that can be set on all events, the following properties can be set on this type of event:

 

Property

Type

Description

GET Events

Boolean

true if an http GET should trigger this event, and false if we should ignore GET requests.

POST Events

Boolean

true if an http POST should trigger this event, and false if we should ignore POST requests.

PUT Events

Boolean

true if an http PUT should trigger this event, and false if we should ignore PUT events.

DELETE Events

Boolean

true if an http DELETE should trigger this event, and false if we should ignore DELETE requests.

 

Properties Available for Child Actions To Use

The following properties are available for use in any child or descendant action:

 

Property

Type

Description

httpMethod

JavaEnum - drop down of:

GET

DELETE

POST

PUT

Specifies which HTTP method was used.

ipAddress

String

The apparent IP address of the request.

userAgent

String

The user agent string reported by the browser.

parameters

Biskit of type HttpRequestParameters, described below

Defines all the parameters provided in the URL or (for a POST) in the body of the request. See below for details and examples.

response

Biskit of type AnonymousHttpResponse

You can modify properties on this response biskit to control what is sent back to the caller. Failing to configure the response will result in a 501 error status being returned.

 

HttpRequestParameters biskits contain no properties by default. Instead, for each parameter specified in the URL, a string-valued property of the same name will be on this biskit with the value of the parameter. For example, if there's an HTTP GET request to http://your_database/anon/something?first=hello&second=world then the event's response biskit would contain properties called first and second with values hello and world respectively. Since these properties do not exist until the HTTP request is received, you must use a workflow function action to extract it, and this would typically be a function like getAsString or getAsInt.

 

The response biskit, of type AnonymousHttpResponse, contains the following properties:

 

Property

Type

Description

status

Java Enum - drop down of all the known response codes, such as "200 OK" and "404 Not Found". See HTTP Response codes.

The HTTP response code that should be returned. The default  is "501 Not implemented". The most comment response code is "200 OK".

headers

Biskit of type HttpHeaders

This contains no properties by default. For every header that is on the request, the headers biskit will have a string-valued property of the same name to store the header value.

contentType

String

Specifies the content type of the response, for example "application/json". See MIME Types

body

String

A string that provides the body of the response you want to provide.