cancel
Showing results for 
Search instead for 
Did you mean: 

Getting error: 415 Unsupported Media Type while going through the Data Hub Trail

Former Member
0 Kudos

Hi,

I'm following the Data Hub trial at the URL:

https://wiki.hybris.com/display/tr52/hybris+5+Developer+Training+Trails+-+Import%2C+Compose%2C+and+P...

and got stuck trying to load raw data by posting the message to the following endpoint:

http://localhost:8080/datahub-webapp/v1/data-feeds/DEFAULT_FEED/items/RawApparelCategory

I applied the headers: Content-Type : application/octet-stream x-tenantId : single

Even with all these settings, I still got the error: 415 Unsupported Media Type

Wondering if theres something I missed?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Yep, thats what I'm experiencing too. That setting is defaulted to "Text" for all my requests that have been failing and even changing it to something else doesn't change the 415 error message.

I'm using the Postman app running on Chrome. Is there a different version?

rafal_gdowski
Active Contributor
0 Kudos

There should be an easy fix for this. When I add a Content-Type: application/octet-stream it always works, even set to Text. There is also a plug-in chrome version that should be available.

Former Member
0 Kudos

Hi Rafal,

So to clarify, are you able to recreate the 415 issue I was having?

If so, how did you resolve it?

rafal_gdowski
Active Contributor
0 Kudos

I don't think it's an issue. I did recreate it, but it as soon as I change back to Content-Type:application/octet-stream it works. Perhaps you can provide a screen shot of how you are setting up your headers in Postman.

Former Member
0 Kudos

Please see the screenshot I just posted in your previous reply. I'm using postman as well.

rafal_gdowski
Active Contributor
0 Kudos

Couple of things: Your Headers button says: Headers(0), and I would get rid of everything in the URL after /RawApparelCategory including the ? so your url looks like this: http://localhost:8080/datahub-webapp/v1/data-feeds/DEFAULT_FEED/items/RawApparelCategory

Former Member
0 Kudos

Of course! I should have seen that.

Thanks so much Rafal!!

Answers (3)

Answers (3)

rafal_gdowski
Active Contributor
0 Kudos

If you are using postman, make sure that the little drop-down selection to the right of [..|raw|binary] is set to 'Text'.

rafal_gdowski
Active Contributor
0 Kudos

I am using Postman Rest Client (Packaged App) and I can re-create your issue. My colleague here is using the Postman plug-in for which the 'Text' setting above has no effect.

Former Member
0 Kudos

Thanks for replying Rafal. I tried setting the Accept header to application/xml, application/json, text/plain and they all still came back with the 415 error.

Any other suggestions?

rafal_gdowski
Active Contributor
0 Kudos

What tool are you using? Can you paste a screen shot in here of how you load the data?

Former Member
0 Kudos

I'm using Postman Rest Client (Packaged App):

rafal_gdowski
Active Contributor
0 Kudos

It could be the case that your Accept: header is set to application/octet-stream. Add Accept: application/xml and see if that helps.