{"action":"closed","issue":{"url":"https://api.github.com/repos/saguiitay/DropboxRestAPI/issues/12","labels_url":"https://api.github.com/repos/saguiitay/DropboxRestAPI/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/saguiitay/DropboxRestAPI/issues/12/comments","events_url":"https://api.github.com/repos/saguiitay/DropboxRestAPI/issues/12/events","html_url":"https://github.com/saguiitay/DropboxRestAPI/issues/12","id":66656032,"number":12,"title":"Automatic handling of HTTP error 429 Too Many Requests","user":{"login":"alexgen","id":4752379,"avatar_url":"https://avatars.githubusercontent.com/u/4752379?v=3","gravatar_id":"","url":"https://api.github.com/users/alexgen","html_url":"https://github.com/alexgen","followers_url":"https://api.github.com/users/alexgen/followers","following_url":"https://api.github.com/users/alexgen/following{/other_user}","gists_url":"https://api.github.com/users/alexgen/gists{/gist_id}","starred_url":"https://api.github.com/users/alexgen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexgen/subscriptions","organizations_url":"https://api.github.com/users/alexgen/orgs","repos_url":"https://api.github.com/users/alexgen/repos","events_url":"https://api.github.com/users/alexgen/events{/privacy}","received_events_url":"https://api.github.com/users/alexgen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-06T17:11:16Z","updated_at":"2015-04-06T20:15:28Z","closed_at":"2015-04-06T20:15:28Z","body":"Dropbox may rate-limit API requests in certain conditions by responding with HTTP 429 (I believe OAuth 1.0 apps would get HTTP 503 in the same case).\r\n\r\nIt would be nice if the library would have an opt-in parameter to automatically backoff in such cases.\r\n\r\nHere is an example response:\r\n```\r\nHTTP/1.1 429 Too Many Requests\r\nServer: nginx\r\nDate: Mon, 06 Apr 2015 15:16:56 GMT\r\nContent-Type: application/json\r\nTransfer-Encoding: chunked\r\nConnection: keep-alive\r\nRetry-After: 60.0\r\n\r\n{\"error\": \"Rate limiting oauth_accesses_per_access_token\"}\r\n```\r\n\r\nAs you can see, the response header includes \"Retry-After\" header, which indicates when it would be safe to repeat the request.\r\n\r\nhttp://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.37\r\n\r\n"}}