Chapter 3

Making Requests


  • Understanding the structure of HTTP requests
  • Issuing HTTP requests from iOS applications
  • Using advanced manipulation of HTTP requests


You can find the code downloads for this chapter at on the Download Code tab. The code is in the Chapter 3 download and individually named according to the names throughout the chapter.

As you may have noticed from the content of previous chapters, the preferred communication approach in iOS is HTTP. The most convenient networking APIs provided in iOS are geared toward HTTP, the HTTP APIs are the most thoroughly documented, and the high level HTTP APIs are well integrated into the run loop-based architecture of an iOS application. It is no wonder that HTTP and HTTPS are the workhorse protocols of iOS network communications.

In this chapter you learn about the structure of HTTP requests and how these requests can be leveraged by your application. The chapter also provides concrete examples of three primary methods to generate HTTP requests and receive HTTP responses and recommendations on when to use or avoid each one. Finally, this chapter explores some more advanced ways to use the HTTP protocol to your advantage.

NOTE In this chapter and the remainder of the book, the term HTTP is used to denote both ...

Get Professional iOS Network Programming: Connecting the Enterprise to the iPhone and iPad now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.