L'interrogation de l'API par le biais de Roulage/PHP

Je suis à la recherche à la Parse.com API REST et de faire des appels à l'aide de la boucle wrapper PHP utilise.

Raw Curl code(travaux):

curl -X GET \
  -H "X-Parse-Application-Id: myApplicationID" \
  -H "X-Parse-REST-API-Key: myRestAPIKey" \
  https://api.parse.com/1/classes/Steps

Code PhP(travaux):

$ch = curl_init('https://api.parse.com/1/classes/Steps');

curl_setopt($ch,CURLOPT_HTTPHEADER,array('X-Parse-Application-Id: myApplicationID',
    'X-Parse-REST-API-Key: myRestAPIKey',
    'Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_exec($ch);
curl_close($ch);

C'est bien et dandy, mais maintenant, quand j'essaie d'ajouter une contrainte de requête:

Raw Curl code(travaux):

curl -X GET \
  -H "X-Parse-Application-Id: myApplicationID" \
  -H "X-Parse-REST-API-Key: myRestAPIKey" \
  -G \
--data-urlencode 'where={"steps":9243}' \
https://api.parse.com/1/classes/Steps

Hélas, nous avons finalement en arriver à ma question - qu'est-Ce que le php analogique pour le code ci-dessus?

Code PHP(ne fonctionne pas):

$ch = curl_init('https://api.parse.com/1/classes/Steps');

$query = urlencode('where={"steps":9243}');

curl_setopt($ch,CURLOPT_HTTPHEADER,array('X-Parse-Application-Id: myApplicationID',
    'X-Parse-REST-API-Key: myRestAPIKey',
    'Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);

curl_exec($ch);
curl_close($ch);

Réponse d'erreur:

Object ( [code] => 107 [error] => invalid json: where%3D%7B%22steps%22%3A9243%7D )

OriginalL'auteur Jonny Ramos | 2013-08-02