Downloading a file (GET)

Use the GET method to download a file from Yandex Disk.

The Range header can be used for requesting a particular section of the file. The response to this type of request contains the header Content-Type: multipart/byteranges.

To request a compressed file, add either the TE: gzip,chunked header to the request, or a combination of two headers:

TE: chunked
Accept-Encoding: gzip

The server will apply compression, if it is justifiable. The client must be prepared to handle both compressed and uncompressed responses.

The application downloads the readme.pdf file from the root directory of the user's Yandex Disk.

GET /readme.pdf HTTP/1.1
Host: webdav.yandex.ru
Accept: */*
Authorization: OAuth 0c4181a7c2cf4521964a72ff57a34a07

If the file exists, the following response is returned:

HTTP/1.1 200 OK
Last-Modified: Mon, 09 Apr 2012 10:56:13 GMT
Etag: 2bf4a775cdaffe827bbad4998b9b09eb
Content-Length: 455833
 
<response body with the file>