Jump to content

REST API Create & Update


marek123

Recommended Posts

HI PrestaShop Team

 

I have an Issue with PrestaShop CRUD REST API.

 

I need test CRUD operation on customers method.

 

i managed to run GET and DELETE operation, because they dont need POST attributes in http request.

GET request is sent to url "http://<<apikey>>@localhost/api/customers/1" request body is empty and headers are:

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22
Content-Type: text/plain; charset=utf-8
Accept: */*
Accept-Encoding: gzip,deflate,sdch
Accept-Language: sk
Accept-Charset: windows-1250,utf-8;q=0.7,*;q=0.3
Cookie: 3f99a2f33f7744ef0eca694ec6b1a644=aoSdSwr65IQIcUY4yBhU7HIvMAOxunUWBfnuOGAaTNGHdom6diAFTgZd1bnNYOYxv%2BtQbqTWZWQaFLMgQIVPQY22WM4c5TsGcnsBMKic0kyWIZXqZ2XIur%2BVo2bgUB25YnUXfSTxPFftjezAVY7gPw%3D%3D000105

 

 

but I have problem with CREATE and UPDATE request.

I sent "CREATE" to this URL "http://<<apikey>>@localhost/api/customers"

 

I tried send Http POST request with attribute xml=<?xml version="1.0" ....

but it failed with server response 500 and no additional info.

I also tried sent xml of new user in request body, and set http content to text/xml

 

but nothing worked.

same is with UPDATE.

 

please can you send me an HTTP example of "CREATE" request, that should work, because i spend half day on those problems.

 

thanks dev team.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...