Legacy Dev Forum Posts

 View Only

Sign Up

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

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

    Posted 06-05-2025 18:44

    Kevin_Qi | 2023-11-01 05:28:37 UTC | #1

    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": [

    "<REDACTED>"

    ]

    }

    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.REMOTEENDPOINT" } ], "errors": [ { "message": "REST call for action execute failed. Message: Request to backend service failed. Response from web service: <HTML>\n<HEAD>\nError 415--Unsupported Media Type\n</HEAD>\n<BODY bgcolor=\"white\">\n<FONT FACE=Helvetica><BR CLEAR=all>\n<TABLE border=0 cellspacing=5><TR><TD><BR CLEAR=all>\n<FONT FACE=\"Helvetica\" COLOR=\"black\" SIZE=\"3\"><H2>Error 415--Unsupported Media Type</H2>\n</FONT></TD></TR>\n</TABLE>\n<TABLE border=0 width=100% cellpadding=10><TR><TD VALIGN=top WIDTH=100% BGCOLOR=white><FONT FACE=\"Courier New\">From RFC 2068 <i>Hypertext Transfer Protocol -- HTTP/1.1</i>:<H4>10.4.16 415--Unsupported Media Type</H4>\n</TD></TR></TABLE>\n</BODY>\n</HTML>\n [8658c036-4b5e-4c96-b75e-fcf02e666095]", "code": "INTERNALSERVER_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: https://developer.genesys.cloud/forum/t/api-response-is-array-of-strings-data-action-returns-unsupported-media/17765/5

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

    Thanks and regards,

    Kevin Qi


    patrick.barry | 2023-11-01 15:46:25 UTC | #2

    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:

    https://testsuite.io/content-type-header#:~:text=Any%20HTTP%2F1.1%20message%20containing,media%20type%20of%20that%20body

    "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?


    Kevin_Qi | 2023-11-03 03:40:28 UTC | #3

    patrick.barry, post:2, topic:22855
    Content-Type: "", or Content-Type: application/octet-stream.

    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!


    system | 2023-12-04 03:40:28 UTC | #4

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


    This post was migrated from the old Developer Forum.

    ref: 22855