解析RESTful API:curl到ajax

时间:2015-01-28 11:21:56

标签: javascript ajax parse-platform

我正在使用Parse RESTful API。我想在使用Ajax发送GET请求时附加一些约束,但是他们网站上的示例都是用curl编写的,例如:

curl -X GET \
  -H "X-Parse-Application-Id: IWphomqAahPnmElGbu8k8NlXvyCCf3YItYZRD03X" \
  -H "X-Parse-REST-API-Key: 2RodxwlOfr1U124ZFu6yBN8bJHvDWoVc60srbOW9" \
  -G \
  --data-urlencode 'where={"playerName":"Sean Plott","cheatMode":false}' \
  https://api.parse.com/1/classes/GameScore

我不知道Ajax中的--data-urlencode等价物。我已经尝试将--data-urlencode之后的约束放入Ajax调用data,但它不起作用。

0 个答案:

没有答案