Daily iOS
Networking

Resuming large downloads and integrity

You're downloading an audio file of several hundred MB, and the app gets terminated or the network drops. You want to resume instead of starting over. Which HTTP headers are involved?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Resuming means sending a partial request with the HTTP Range header starting from the bytes you have, and the server answers with 206 Partial Content and Content-Range. Check support through Accept-Ranges, and on iOS resume through downloadTask's resumeData, which still requires the server to support Range.

Share a question