Lior Z
Lior Z

Reputation: 668

Make HTTP Get request in iOS with params

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

Upvotes: 0

Views: 88

Answers (1)

Paulw11
Paulw11

Reputation: 114875

In a GET method the parameters are passed in the query string - so you suffix your URL with something like ?param1=value1&param2=value2&param3=value3. You may need to percent-encode your query string if it contains characters like space, & or =

Upvotes: 3

Related Questions