Content types
The Content-Type field in HTTP headers
indicates in which format the data is sent to, or returned by, the
HTTP methods of the Rule
Execution Server REST
API.
For each method, the Response Content sections provide details and examples of the format in which data is sent in requests and objects are returned in responses. To read the details for a method, click View Schema or View Example in the page of the REST API reference manual for that method.
Content description
The Rule
Execution Server REST
API supports the following content types:
- application/xml
- XML is the default content type of the response. For details about the format of each returned object, see the XML schema specifications for each operation. You can also find the object definitions by retrieving the WADL (Web Application Description Language) file.
- application/json
- As an alternative to setting the Content-Type HTTP headers, you
can include the format in the URI path, after the version number.
Example:
POST /api/v1/json/ruleapps?... - application/octet-stream
- This content type produces a file. Some services require that you send a BLOB data section.
- If the action receives the
application/octet-streamMIME type, provide your file as is. - As an alternative to sending the file as the
bodypart of the HTTP request, you can include the BLOB data directly in the XML or JSON representation, in one of two ways:- Encode the file in Base64 and pass it as a value for the
bodypart. - Use a multipart POST request. To post a valid multipart request,
write the XML or JSON code in a part named
body. All other parts of the request can receive files and have a unique identifier. In this case, the system always handles the BLOB section as an identifier and picks the corresponding file in the multipart request. The fallback is the classic system BLOB representation in Base64.
Example:curl --form body=@request.xml --form MyArchiveReference=@ruleset.jar --user resAdmin:resAdmin http://localhost:9080/res/apiauth/ruleapps/MyRuleApp/1.0/rulesetsIn this example, the request.xml file contains the following XML code:<ruleset> <name>MyName</name> <version>1.5</version> <displayName>Hello World !</displayName> <archive>MyArchiveReference</archive> </ruleset> - Encode the file in Base64 and pass it as a value for the
- If the action receives the
Example
- Click this path .
- In the Decision Server REST API - ruleapps Resource - GET Method page, click View Schema.