This page explains the REST Adapter in Bridge context. If you were looking for the same information regarding the PAS Designer, refer to REST Adapter in the Designer guide. |
Attribute | Description | Allowed Values | |
---|---|---|---|
alias | Specify the REST alias the adapter should connect to. | a valid REST alias | |
digestAlgorithm | None | No header generated. | |
MD5 | Generate header using MD5 algorithm. | ||
SHA | Generate header using SHA algorithm. | ||
SHA-1 | Generate header using SHA-1 algorithm. | ||
SHA-256 | Generate header using SHA-256 algorithm. | ||
SHA-512 | Generate header using SHA-512 algorithm. |
This stereotype defines a package as REST interface. It has no additional tagged values.
Since Runtime 2022.6 the Runtime uses Transfer-encoding: chunked for POST requests. |
Tagged Value | Description | Allowed Values | |||
---|---|---|---|---|---|
Http Method (httpMethod) | a valid HTTP method | GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS | |||
none |
| ||||
Relative Path (relativePath) | none | The name of the REST method will be used. | |||
any valid string | The given name will be used. The relative path may also contain variables (REST path parameters, specified as :<variable name> ) and can be segmented like e.g. /date=:<a date variable> . | ||||
Is Verbatim Path (isVerbatimPath) | Disable most of the path normalization. All escaping must be done manually, leading or trailing whitespaces are preserved.
| true | Path should be treated as verbatim, path normalization is disabled. | ||
false (default) | Path should be URL encoded. | ||||
Blob Body Content Type (blobBodyContentType) |
| a list of valid media ranges | e.g.
application/msexcel
Default is
application/octet-stream
if not specified. | ||
Reject Other Response Content Type (rejectOtherResponseContentTypes) |
| true |
| ||
false | Perform the adapter call in spite of content-type header mismatch, and let the service handle this. | ||||
Accepted Request Content Type (acceptedRequestContentType) |
| a list of valid media ranges | e.g. | ||
Reject Other Request Content Types (rejectOtherRequestContentTypes) |
| true |
| ||
false | Perform the adapter call in spite of accept header mismatch and let the service handle this. |
With the REST Adapter, the E2E Runtime can handle JSON or XML as content types. The E2E Runtime will parse either response content (JSON or XML) to a response object automatically.
You do not need to set any headers. If no headers are set, the Runtime will use JSON as a default format and set Accept header to application/json,text/json,application/xml;q=0.9,text/xml;q=0.9,*/*;q=0.8
.
If you want to control the REST request and response formats, you can set the Content-Type and Accept headers as described on Setting REST Request Options.
application/json
for JSONapplication/xml
for XMLThis mechanism also works vice versa: setting the Content-Type header and letting the E2E Runtime deduce the Accept header:
application/json
for JSONapplication/xml
for XMLapplication/json,text/json,application/xml;q=0.9,text/xml;q=0.9,*/*;q=0.8
for JSONapplication/xml,text/xml,application/json;q=0.9,text/json;q=0.9,*/*;q=0.8
for XMLSetting the content type headers to any value other than JSON or XML is not supported and the E2E Runtime will throw an exception in this case.
Regarding response parsing, the E2E Runtime will process REST responses as follows: