benjaminjackman / looty

Looty! A tool for Path of Exile that makes inventory searching fun!
GNU General Public License v2.0
61 stars 21 forks source link

Respect Rate Limit Headers #24

Open johnkernke opened 6 years ago

johnkernke commented 6 years ago

There are a few headers that get returned to help ease load on the API server. I noticed there was "probably throttling" when getting tabs, and looked through the requests and noticed the following headers are sent back after each request:

X-Rate-Limit-Account
X-Rate-Limit-Account-State
X-Rate-Limit-Policy
X-Rate-Limit-Rules

It would pay to look into these more and make the app not request more than is allowed.

benjaminjackman commented 6 years ago

Thanks for pointing that out! I didn't notice (or those didn't exist) when I wrote request layer a few years ago. If I go in there again I'll definitely look into using them. If you want to submit a patch that did I would be happy to accept it.