Get Metadata from Dropbox Link Without Auth

后端 未结 1 2014
遥遥无期
遥遥无期 2021-01-22 20:14

I want to check for a version changed/get metadata of a text-file with a shared link on dropbox. I will not be using dropbox api as it makes users use their own accounts. I want

1条回答
  •  一整个雨季
    2021-01-22 20:43

    If you do an HTTP HEAD request against a public or shared Dropbox URL, you'll get, among other things, an etag header. I don't know that this behavior is guaranteed, since I don't think it's documented anywhere, but at least for now the etag header can be used to determine when a file has changed. (If the etag is different, the file has changed.)

    EDIT

    In general when using ETags, the most efficient thing to do is issue a GET request with a header of If-None-Match: . If the content hasn't changed, this will respond with a 304, but if the content has changed, this will download the new content as per a normal GET request (and the response will be 200).

    0 讨论(0)
提交回复
热议问题