Jump to content

Update customer got error String could not be parsed as XML XML length


Recommended Posts

I am building mobile application of Prestashop site using react native.

I tried updating customer with 'PUT' method.

My url: 'http://my.com/api/customers/?xml= xmlns:xlink="http://www.w3.org/1999/xlink"><customer><id>70></id><firstname>Mizeva11111</firstname></customer></prestashop>'

My purpose is changing firstname from 'Mizeva' to 'Mizeva11111'.

But I got error 'String could not be parsed as XML  length : 0' and error code '127'.

 

So I tried other method.

Header:

Authorization: Basic REhZMVQ5VEpJWjc1TFJWWDYxMkkxTkhGODhZVlUyWk06

Content-Type: application/x-www-form-urlencoded

Accept: text/xml (or application/xml)

Url:

http://my.com/api/customers/70?schema=synopsis

Body: xml = <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"><customer><id>70></id><firstname>Mizeva11111</firstname></customer></prestashop>

In this case, I got '412 Precondition Failed: The precondition on the request for the URL /api/customers/ evaluated to false. Additionally, a 412 Precondition Failed
error was encountered while trying to use an ErrorDocument to handle the request.'

I didn't find solution.

I'd like to help me.

Thanks.

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...