on ‎2021 Jan 06 9:05 AM
Hi Dear Experts,
I have an issue to use a PUT method.
The problem is in the PUT request. In API says to define request header as Content-Type:application/octet-stream
I tried to define in WADL file this type

I got unsupported type error

After that I tried to change the header like this

And this one

In both cases I get HTTP 500 error

This error due double header collision (json + octet-stream)
The problem is that I can't remove the json header, I don't have any setting for it. It's absolutely automatic.
Many thanks for any help and support.
Gilles
Request clarification before answering.
I am also running into the same issue, wherein the API I am dealing with (8x8) requires Content-Type=application/x-www-form-urlencoded in the header. When I put it as a Standard HTTP Header Field, it certainly picks it up, but then throws an error as there are now duplicate Content-Type entries. This can easily be replicated in SOAP UI.
From the trace...
TRAN 9/14/2022 9:13:53 AM Content-Type: application/json; charset=utf-8
TRAN 9/14/2022 9:13:53 AM Content-Type: application/x-www-form-urlencoded
TRAN 9/14/2022 9:13:54 AM HTTP/1.1 400 Bad RequestTRAN 9/14/2022 9:13:54 AM {"fault":{"faultstring":"Duplicate Header \"Content-Type\"","detail":{"errorcode":"protocol.http.DuplicateHeader"}}}There is no way around this?...You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gilles,
Please check the below
The URL for the external web service works as expected in SoapUI or POSTMAN
Root Case: The Data Services REST web service datastore only supports the mediatypes of application/XML and application/JSON. When this header is missing or malformed, the server will automatically use application/octet-stream by default
Please refer to SAP Note 2404163 - Failure importing function in a REST web service datastore - Data Services.
Also refer Data Services Integrator Guide
Regards
Arun Sasi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arun,
Thank you for your comment.
I'm working with Gilles on this issue.
2404163 does not help - "use a supported mediatype" is useless resolution
For all another requests (GET,POST) we use mediaType="application/json" without any header parameter and it's works well. So I understand, that Data Services use application/json header by default and not application/octet-stream
If
we use application/json mediatype, we get "Unsupported Media Type
Error" from the API. Exactly like we get in Postman with this type in
header.
Also this error we get, if we put mediaType="*/*" or mediaType="application/json; type=application/octet-stream" and header Content-Type parameter is empty.
Best Regards
Benjamin Paz
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 7 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.