Define if the service should reject the request with HTTP 406 (Unsupported Media Type) if the client request has accept headers that differ from the ones defined with Blob Body Content Type. The Runtime reads the related "Accept" header and compares it to the content types that can be provided by the service (Blob Body Content Type). |
ExamplesThe RESTAPI_BlobContent_Example and the RESTAdapter_BlobContent_Example implement a server and a client that exchange blob content (pictures). They have the following blob content setup implemented: Server (RESTAPI_BlobContent_Example) | Content Type Settings | Description |
---|
Store a picture | POST /picture | Accepted Request Content Type | image/png;image/jpeg | The server can store PNGs and JPGs. | Return a picture by id | GET /picture/<an id> | Blob Body Content Type | image/png | The server returns PNGs upon request. | Client (RESTAdapter_BlobContent_Example) | Content Type Settings |
|
---|
Send a picture | POST /picture | Accepted Request Content Type | image/png | The client sends PNGs. | Retrieve a picture | GET /picture/<an id> | Blob Body Content Type | image/png;image/jpeg | The client accepts PNGs and JPGs as a response. | Good CasesThe following table shows some example calls and how they would be executed. Client | Generated Header | Server |
---|
1 | Store a picture
| POST /picture | Content-Type: image/png | → | accepts request |
|
| ← | returns id HTTP 201 | 2 | Retrieve a picture | GET /picture/123456 | Accept: image/png | → | accepts request |
| Content-Type: image/png | ← | returns picture PNG | Error CasesThe following table shows some error cases and their consequences if you do not rely on the automatically generated headers but set your own headers instead. Example | Client | Custom Header | Server |
---|
1 | Store a picture, wrong content type | POST /picture | Content-Type: image/svg+xml | → | accepts request |
|
|
| | 2 | Store a picture, wrong content type, server rejects other content types
| POST /picture | Content-Type: image/svg+xml | → | Reject Other Request Content Types = true |
|
| ← | | 3 | Store a picture, wrong content type, client rejects other content types
| POST /picture Reject Other Request Content Types = true | Content-Type: image/svg+xml | ↓ | not called at all | RESTLM/7: Endpoint '<endpoint URL>' does not declare '<content type>' as accepted content type
|
| ← |
| 4 | Retrieve a picture, wrong content type
| GET /picture/123456 | Accept: image/svg+xml | → | accepts request |
|
|
| | 5 | Retrieve a picture, wrong content type, server rejects other content types | GET /picture/123456 | Accept: image/svg+xml | → | Reject Other Response Content Type = true |
|
| ← | RESTLM/10: Cannot generate any of the expected output formats (image/svg+xml - HTTP 406 (Not Acceptable)
|
|