Performing HTTP(S) asynchronous GET requests

In this recipe, we will create a WebServiceConnectAsynchronous class that will be able to perform an HTTP GET request asynchronously. If we follow the HTTP specifications to the letter, we would be using the HTTP GET request to retrieve data from a server. For example, when you request a web page from a server, you submit an HTTP GET request.

For an HTTP GET request, if any parameters need to be sent to the resource, they should be included in the URL. There are two primary ways to include the parameters in a GET request:

  • Path parameter: In this method, the parameters are part of the URL path itself. For example, in the URL http://mytest.com/testservice/value1, the value1 path element is the parameter. ...

Get iOS and OS X Network Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.