Request specs

A request spec is an extension of a url pattern to specify the method and how to construct the body of a request. See the main Url patterns page to understand more about the context in which this might be used.

[ <method> [ <body source path> ] ] <url pattern>

If the method is omitted, POST is assumed. By convention, Restspace services which act as filters process their inputs when they receive a POST request, whereas GET and PUT are used to read and write configuration. The special method $METHOD is used to indicate the method should be the same as the original or parent request e.g. in a pipeline.

The body source path is the property path on the associated data object (usually the originally posted data) which is used for the JSON body of this request. Here the special property path $this means use the whole data object. For example:

POST attachmentData /email/$>1

which means do a post to /email/<second element in service path> sending the .attachmentData property of the original request body as the request body of this request.