I want to translate the following GET request to an instance of NSMutableURLRequest:
curl -X GET \
-H "X-Parse-Application-Id: sdasfasdf" \
-H "X-Parse-REST-API-Key: asdfasdfasdfasd" \
-G \
--data-urlencode 'where={"arrayKey":2}' \
https://api.parse.com/1/classes/RandomObject
I know how to set the headers and the method, but not how to add the --data-urlencode part.
Can anyone help me with this? Thanks.
You may encode the string using the
-[NSString stringByAddingPercentEscapesUsingEncoding:]method. Then, you just need to append the string to the URL.