IBM-MIL / IBM-Ready-App-for-Retail

Ready App to create a contextual shopping experience based on location (using beacons) in a retail environment.
https://developer.ibm.com/open/ibm-ready-app-for-retail
Other
38 stars 26 forks source link

Failed to Populate your Cloudant database #26

Open obsicn opened 8 years ago

obsicn commented 8 years ago

When I populate the cloudant database, I faced following error. How to solve this problem? Thanks a lot.

MichaeldeMacBook-Pro:SummitDBInventory myang$ pwd /Users/myang/workspaces/IBM-Ready-App-for-Retail/db/SummitDBInventory MichaeldeMacBook-Pro:SummitDBInventory myang$ ls summit_db.json

MichaeldeMacBook-Pro:SummitDBInventory myang$ curl -u 4422a209-265a-4065-bb3f-d0f315de7934-bluemix -d ./summit_db.json -X POST https://4422a209-265a-4065-bb3f-d0f315de7934-bluemix.cloudant.com/readyapp-retail/_bulk_docs -H "Content-Type:application/json" Enter host password for user '4422a209-265a-4065-bb3f-d0f315de7934-bluemix': {"error":"bad_request","reason":"invalid UTF-8 JSON"}

hwassall commented 7 years ago

I had the same issue which I resolved by placing single quotes around the header parameter i.e. -H 'Content-Type:application/json'. I also noted that the -d parameter is incorrect, it should be -d @summit_db.json. I now get {"error":"bad_content_type","reason":"Content-Type must be application/json"} as a response and so still do not get any further... Can we get an answer to this please?