O'Reilly logo

iOS and OS X Network Programming Cookbook by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required