cancel
Showing results for 
Search instead for 
Did you mean: 

401 bad request

Former Member
0 Kudos

Hi I set up stand alone data hub on apche tomcat once I hit below url

GET - http://localhost:8080/datahub-webapp/v1/data-feeds/DEFAULT_FEED/ I am getting 200 successmessage through rest client as specified in wiki (You should get a 200 Success message in response, which shows the Data Hub is running properly.) But when I am trying to push data with below url specified in wiki

POST - http://localhost:8080/datahub-webapp/v1/data-feeds/DEFAULT_FEED/items/RawProduct HEADER: Content-Type: application/octet-stream / x-tenantId: single

BODY:

ourceId,isoCode,baseName,baseDescription,ean,manufacturerName,manufacturerAid,unit,style,size,SKU,category,styleDescription M25687,en,"T-Shirt Men Playboard Skull SS",,,,,pieces,,,,, M25687,de,"Herren T-Shirt Playboard Skull SS",,,,,pieces,,,,, M25687,,,,,,,,,,,tshirts getting 401 bad request and it says header content type is wrong.

Can you Please let me know what could be the issue and if use header content typeas application/Json I am getting unsupported media type

rafal_gdowski
Active Contributor
0 Kudos

Can you grab a screen shot of what you are doing and post it here. Everything above looks correct (other than sourceId missing an 's', but it's probably a copy-n-paste error)

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You need to add these headers (Content-Type: application/octet-stream and x-tenantId: single) separately

rafal_gdowski
Active Contributor
0 Kudos

,

It does look like your headers are 'combined' somehow. Just get rid of x-tenantId:single. You don't really need it.

Former Member
0 Kudos

Hi Thanks for the inputs.As you said I added header as Content-Type:application/octet-stream and accessed below post url

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

now also I am getting 400 bad request error but now error message coming as message": "RawProduct type is not a valid RawItem type", and as per wiki I added pcm-apparel-canonical-5.7.0.0-RC5,pcm-apparel-raw-5.7.0.0-RC5,pcm-apparel-target-5.7.0.0-RC5 jar files in my tomcat lib folderalt text.

Could you please let me know if you have any idea on this !

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi may I know how did you set up the standalone data hub? I cannot make it work with authentication (http://localhost:8080/datahub-webapp/v1/data-feeds/DEFAULT_FEED/), I followed all the steps in wiki, but still failed, could you please provide some tips or your install steps for me? Thanks!

Former Member
0 Kudos

You need to change the authentication in modeule.properties of tomcat>webapps>datahub-webapp/WEB-INF/classes.

Though youcan also create a local properties file, which overrides above property file.

Former Member
0 Kudos

Hi Thanks for the inputs.As you said I added header as Content-Type:application/octet-stream and accessed below post url

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

now also I am getting 400 bad request error but now error message coming as message": "RawProduct type is not a valid RawItem type", and as per wiki I added pcm-apparel-canonical-5.7.0.0-RC5,pcm-apparel-raw-5.7.0.0-RC5,pcm-apparel-target-5.7.0.0-RC5 jar files in my tomcat lib folder.

Could you please let me know if you have any idea on this

rafal_gdowski
Active Contributor
0 Kudos

Yes, your extension has most likely not loaded.

Former Member
0 Kudos

Hi Jagdish,

Unfortunately, I missed notification regarding this further question and not sure if you are still looking for the solution. You need to add the jars (pcm-apparel-canonical-5.7.0.0-RC5,pcm-apparel-raw-5.7.0.0-RC5,pcm-apparel-target-5.7.0.0-RC5) under tomcat>webapps>datahub-webapp>WEB-INF>lib folder.

Thanks, Arvind

Former Member
0 Kudos

Hi Please find attached screen shot

[1]: /storage/temp/5162-datahub.png