25.12.2013 Views

URL Loading System Programming Guide - Apple Developer

URL Loading System Programming Guide - Apple Developer

URL Loading System Programming Guide - Apple Developer

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Contents<br />

Making a POST Request 36<br />

Retrieving Data Using a Completion Handler Block 38<br />

Retrieving Data Synchronously 38<br />

Using NS<strong>URL</strong>Download 40<br />

Downloading to a Predetermined Destination 40<br />

Downloading a File Using the Suggested Filename 42<br />

Displaying Download Progress 44<br />

Resuming Downloads 46<br />

Decoding Encoded Files 46<br />

Encoding <strong>URL</strong> Data 48<br />

Handling Redirects and Other Request Changes 50<br />

Authentication Challenges and TLS Chain Validation 53<br />

Deciding How to Respond to an Authentication Challenge 53<br />

Responding to an Authentication Challenge 54<br />

Providing Credentials 54<br />

Continuing Without Credentials 55<br />

Canceling the Connection 56<br />

An Authentication Example 56<br />

Performing Custom TLS Chain Validation 57<br />

Understanding Cache Access 58<br />

Using the Cache for a Request 58<br />

Cache Use Semantics for the HTTP Protocol 59<br />

Controlling Caching Programmatically 59<br />

Cookies and Custom Protocols 62<br />

Cookie Storage 62<br />

Protocol Support 63<br />

Life Cycle of a <strong>URL</strong> Session 64<br />

Life Cycle of a <strong>URL</strong> Session with <strong>System</strong>-Provided Delegates 64<br />

Life Cycle of a <strong>URL</strong> Session with Custom Delegates 66<br />

Document Revision History 70<br />

2013-10-22 | Copyright © 2003, 2013 <strong>Apple</strong> Inc. All Rights Reserved.<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!