Jump to content

Client REST pour webservice Prestashop


Recommended Posts

Bonjour a tous.

 

Je viens de créer un webservice avec prestashop mais je ne sais pas comment l'interroger.

 

J'ai vu que c'était une architecture REST et qu'il fallait utiliser la fonction "file_get_contents" mais ca m'affiche un résultat pas tres convainquant on va dire.

 

Mon code :

--------------------------------------------------------------------------------------------------------------------------

 

$livre = file_get_contents('http://maclé@monsite/prestashop/api/products/9');

 

 

var_dump ($livre);

--------------------------------------------------------------------------------------------------------------------------

 

Mon résultat :

---------------------------------------------------------------------------------------------------------------------------

 

string '<?xml version="1.0" encoding="UTF-8"?>

<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">

<product>

<id><![CDATA[9]]></id>

<id_manufacturer><![CDATA[0]]></id_manufacturer>

<id_supplier><![CDATA[0]]></id_supplier>

<id_category_default xlink:href="http://dev.quicksource.fr/Udirev/prestashop/api/categories/6"><![CDATA[6]]></id_category_default>

<new></new>

<cache_default_attribute><![CDATA[0]]></cache_default_attribute>

<id_default_image xlink:href="http://dev.quicksource.fr/Udirev/prestashop/api/i'... (length=6989)

---------------------------------------------------------------------------------------------------------------------------

Et avec ca je n'ai aucun moyen de récupérer les information pour les stocker dans une variable.

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