Skip to Content

Token from REST API through SAP PO 7.5 SPS (querystring and x-www-form-urlencoded)

Hi Team,

While trying to get the OAuth token from REST API through SAP PO 7.5 is failing with error "HTTP error occurred: Unsupported Media Type". But the same when tested through SOAP UI and POSTMAN works perfectly fine.

In SOAP UI/POSTMAN, we are not providing any AUTH and in body selected as "x-www-form-urlencoded" with 2 key value pair( username: "xyz" password:"abc").

And in REST adapter receiver provided the same URL and method POST and when triggered it is failing with "Unsupported Media Type" The scenario was SOAP=>PO=>REST. Tried with URL replacement, message transform bean and other work arounds available on SDN.

Kindly suggest.

Thanks,
FA

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 29 at 10:23 PM

    Hello Farooq,

    To send requests with content type 'application/x-www-form-urlencoded', I would suggest using HTTP adapter rather than REST adapter. For REST adapter, more common use cases are requests with content type 'application/xml' (for XML format) and 'application/json' (from JSON format).

    Regards,
    Vadim

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Farooq,

      Looks like escaping of '&' symbol that you have to use and that I put in the provided code, got unescaped by the editor tool here, when I pasted here - I don't see it being properly escaped in my earlier reply. Before 'Password' text, '&' shall be escaped as '&'. Let me post screenshot of transformation's code here, so that you see how it looks like in the original version that I referred to:

      Regards,

      Vadim