Versions Compared

Key

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

...

The syntax of a REST API is as follows.

Code Block
languagexml

<api xmlns="http://ws.apache.org/ns/synapse"
     name="stringAPIName"
     context="/stringAPIContext" [hostname="string"] [port="integer"]>
   <resource methods="OPTIONS DELETE GET" uri-template="/url-template">
      <inSequence>
        ...
      </inSequence>
      <outSequence>
         ...
      </outSequence>
   </resource>
</api>

 

An API definition is identified by the <api> tag. Each API must specify a unique name and a unique URL context (see below). An API is made of one or more resources, which is a logical component of an API that can be accessed by making a particular type of HTTP call. For example:

...