For the More Curious: The Request Body
When NSURLSessionTask talks to a web server, it uses the HTTP protocol. This protocol says that any data you send or receive must follow the HTTP specification. The actual data transferred to the server in this chapter is shown in Figure 21.7.
Figure 21.7 HTTP request format
NSURLRequest has a number of methods that allow you to specify a piece of the request and then properly format it for you.
Any service request has three parts: a request-line, the HTTP headers, and the HTTP body, which is optional. The request-line is the first line of the request and tells the server what ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access