0

I am using PUT request to change name of product entity id 1 in Magento 1.8. I am using below details while using PUT request:

A. Oauth1.0 key credentials like secret key, etc

B. Headers:

Content-Type: application/json
Accept: application/json

C. Body:

{"name":"test"}

D. url:

http://URL/api/rest/products/1

When I use POST request, I am getting below error:

{"messages":{"error":[{"code":400,"message":"Content-Type header is empty"}]}}

Please advise on where am I making mistake. I have searched at many places but I am unable to get it done.

===

EDIT:

Someone advise me to add Content-Length in the header. So I used POSTMAN to add it as REST Client was denying me to use it.

In POSTMAN, when I do not use Content-Length, it throws same error but when I use Content-Length in the header, it keeps running for sometime. Finally I had to cancel the request manually to stop it.

Please advise on how to make a successful PUT request.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.