O'Reilly logo

Cocoa® Programming for Mac® OS X, Fourth Edition by Aaron Hillegass, Adam Preble

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

Chapter 28. Web Services

Web services are getting a lot of hype. In the end, however, a Web service is just an HTTP request and response where each may be carrying XML data (Figure 28.1). So using a Web service from Cocoa is simply a matter of being able to send HTTP requests and receive responses and it also may require generating and parsing XML or JSON.

Figure 28.1. Your Average Web Service in Action

Image

HTTP requests and responses are handled by NSURL, NSURLRequest, and NSURLConnection (Figure 28.2).

Figure 28.2. Classes for Making HTTP Requests

Generating and parsing XML is typically done in one of two ways. The high-level method is to use ...

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