Featured image of post What Is a Request Header?

What Is a Request Header?

# Definition

A request header is information sent by a requesting device to a receiving server asking the server to return a particular response. In the world of podcasting this would be a podcast listening app like Apple Podcasts requesting an audio file of a particular episode. There are two types of requests that are especially elevant to podcasting analytics and the primary difference between the two is contained within the request header.

A progressive download made by the requesting device will send a Range: bytes=x-z request header and a normal download will not.

While certain headers are expected in every request, a requesting device is not limited to a certain a set of allowed headers and can pass arbitrary headers. Apple Podcasts for instance sends an X-Playback-Session-Id when making a byte-range request. The MDN Web Docs have a much more detailed explanation around what request headers are.

# Examples

# Apple Podcasts (Download)

1
2
3
4
5
6
7
GET /url/of/audio.mp3 HTTP/1.1
Host: audiohost.com
Accept: */*
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
Accept-Encoding: gzip, deflate, br
User-Agent: Podcasts/4023.540.3 CFNetwork/1494.0.7 Darwin/23.4.0

# Apple Podcasts (Progressive Download)

1
2
3
4
5
6
7
8
9
GET /url/of/audio.mp3 HTTP/1.1
Host: audiohost.com
X-Playback-Session-Id: DAF7C419-2CCA-4C1F-9446-9F037305FB75
Range: bytes=0-30920487
Accept: */*
User-Agent: Podcasts/4023.540.3 CFNetwork/1494.0.7 Darwin/23.4.0
Accept-Language: en-US,en;q=0.9
Accept-Encoding: identity
Connection: keep-alive

# Spotify (Download)

According to my research, when clicking the “download” icon on the Spotify App (MacOS/iOS), Spotify does not make traditional download requests and instead makes progressive download requests of 10mb chunks until the entire file is downloaded.

# Spotify (Progressive Download)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
GET /url/of/audio.mp3 HTTP/1.1
Host: audiohost.com
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache, no-store
Accept-Encoding:
Range: bytes=0-3145727
User-Agent: Spotify/123400783 OSX/0 (MacBookPro15,2)
Accept-Language: en-US,en;q=0.9
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: no-cors
Sec-Fetch-Dest: empty
Built with Hugo
Theme Stack designed by Jimmy