Jump to content

Problem with api using curl in shell


Recommended Posts

Hello, every one.

 

I cannot figure out how to solve next problem. No solution I found in google.

 

I'm trying to send shell curl request to api. (Prestashop 1.5.3.1)

 

curl -X POST -T ./myxmlfile 'http://[email protected]/api/customers' -v

 

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<customer>
	<id></id>
	<id_default_group></id_default_group>
	<newsletter_date_add></newsletter_date_add>
	<ip_registration_newsletter></ip_registration_newsletter>
	<last_passwd_gen></last_passwd_gen>
	<secure_key></secure_key>
	<deleted></deleted>
	<passwd>ttestasdasd</passwd>
	<lastname>ttest</lastname>
	<firstname>ttest</firstname>
	<email>[email protected]</email>
	<id_gender></id_gender>
	<birthday></birthday>
	<newsletter></newsletter>
	<optin></optin>
	<website></website>
	<company></company>
	<siret></siret>
	<ape></ape>
	<outstanding_allow_amount></outstanding_allow_amount>
	<show_public_prices></show_public_prices>
	<id_risk></id_risk>
	<max_payment_days></max_payment_days>
	<active></active>
	<note></note>
	<is_guest></is_guest>
	<id_shop></id_shop>
	<id_shop_group></id_shop_group>
	<date_add></date_add>
	<date_upd></date_upd>
<associations></associations>
</customer>

 

I also tried to add "xml=" in the beginning of the file.

 

The result of the request is 500 error. To trace the error is impossible.

 

I tried this request through PSWebServiceLibrary.php with debug option and it works. So xml file is correct.

 

Help, please)))

Edited by dima_tr (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...