如何在没有--data-url-encode的情况下解释Parse REST API?

时间:2014-03-18 13:45:21

标签: json curl parse-platform

对于Prase REST API,我们可以

curl -X GET \
  -H "X-Parse-Application-Id: Y6i5v9PQOAAGlnKnULJJu5odT72ffSCpOnqqPhx9" \
  -H "X-Parse-REST-API-Key: T6STkwY6XqVMySTbqeSZfmli3naZZK9KoxnAcEhR" \
  -G \
  --data-url-encode 'where={"username":"someUser"}' \
  https://api.parse.com/1/users

现在我尝试在没有--data-url-encode的情况下发送请求,但要将相关查询附加到网址https://api.parse.com/1/users,我该怎么办?

我试过

curl -X GET \
      -H "X-Parse-Application-Id: Y6i5v9PQOAAGlnKnULJJu5odT72ffSCpOnqqPhx9" \
      -H "X-Parse-REST-API-Key: T6STkwY6XqVMySTbqeSZfmli3naZZK9KoxnAcEhR" \
      -G \
      https://api.parse.com/1/users?where={"username":"someUser"}

但它没有用。

谢谢。

1 个答案:

答案 0 :(得分:1)

首先将where={"username":"someUser"}编码为where%3D%7B%22username%22%3A%22someUser%22%7D,然后

curl -X GET \
      -H "X-Parse-Application-Id: Y6i5v9PQOAAGlnKnULJJu5odT72ffSCpOnqqPhx9" \
      -H "X-Parse-REST-API-Key: T6STkwY6XqVMySTbqeSZfmli3naZZK9KoxnAcEhR" \
      -G \
      https://api.parse.com/1/users?where%3D%7B%22username%22%3A%22someUser%22%7D

作品

相关问题