Content-type error when connecting to Oracle API via web service data action

Hello Everyone,

Hope all is well.

Please we are setting a Web service data action to connect to an Oracle REST API endpoint.

We have an issue where the Oracle endpoint is not accepting the “Content-Type” header in the GET request.

In our data action we are not sending any “Content-Type” header, however, Oracle is seeing this and rejecting it:

{

"Authorization": [

""

]

}

Response from Oracle:

{
"message": "The server encountered an unexpected condition which prevented it from fulfilling the request.",
"code": "internal.server.error",
"status": 500,
"messageParams": {},
"contextId": "8658c036-4b5e-4c96-b75e-fcf02e666095",
"details": [
{
"errorCode": "ACTION.REMOTE_ENDPOINT"
}
],
"errors": [
{
"message": "REST call for action execute failed. Message: Request to backend service failed. Response from web service: \n\nError 415--Unsupported Media Type\n\n<BODY bgcolor="white">\n
\n

\n

\n<FONT FACE="Helvetica" COLOR="black" SIZE="3">

Error 415--Unsupported Media Type

\n
\n
<FONT FACE="Courier New">From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:

10.4.16 415--Unsupported Media Type

\n
\n\n\n [8658c036-4b5e-4c96-b75e-fcf02e666095]",
"code": "INTERNAL_SERVER_ERROR",
"status": 415,
"messageParams": {},
"details": [],
"errors": []
}
]
}

Customer reached out to Oracle support and they have advised that Oracle does not accept any content type header for GET requests.

We found this Oracle Support Document below that explains the behaviour.

The Oracle document does mention for GET operation (with no request payload), sending Content-Type header is invalid and OIC will reject it with "Error 415--Unsupported Media Type" and it's work as designed.

This looks like the intended design by Oracle.

Oracle suggestion is to work with the client application to remove the header for GET operation.

According to this post, it appears that Genesys Cloud sends the content-type: JSON by default:

Please could we check if there is any way we can work around this limitation? Thank you.

Thanks and regards,

Kevin Qi

While invoking an Action, and not providing a content-type, we default by adding Content-Type: application/json. One thing you can try is to provide Content-Type: "", or Content-Type: application/octet-stream. The last suggested value came from reading this:

"If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream"."

Although content-type on request is not needed on an http request with no body, it should not be considered an error. So at this point, we are just trying to work around Oracle. Have you filed a bug with them?

1 Like

Thank you Partick, send an empty Content-Type header appears to do the trick here, we are now getting a response from Oracle. Much appreciated!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.