I want to make an HTTP GET request from my iOS client and place in the request params. I have written code that performs a POST request, where it was very easy to use setHTTPBody to place a NSData* object in the request. How is this done for a GET request?
Thanks
In a GET method the parameters are passed in the query string - so you suffix your URL with something like ?param1=value1¶m2=value2¶m3=value3. You may need to percent-encode your query string if it contains characters like space, & or =
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.