-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow user to pass headers to jikan requests #57
Comments
304 can be tested in the following way
Better explained with a diagram: https://jikan.docs.apiary.io/#introduction/cache-validation |
As per the discussion in discord:
For https://2.python-requests.org/en/master/api/#requests.request Accept a subset of the kwargs that are relevant (to avoid confusion with headers The other ones we can ignore since we're the ones creating data for them: Or theyre just not relevant: data (for post requests) Similarly, accept a subset of kwargs from https://aiohttp.readthedocs.io/en/stable/client_reference.html#aiohttp.ClientSession.request Document which kwargs are allows to be passed. Add a function: _check_request that gets called before the request is sent, that checks (jikan/aiojikan specific) if the kwargs are allowed (by defining a list of them in |
Could probably just wait till v4 since some subset of the API will have to be rewritten to handle passing the JWT, and the parameter checks are being removed anyways. |
As stated in #54, adding header support would be good to allow users to bypass caching, and compare ETag values
Current thoughts/issues:
_wrap_response
already works for ETag checking (304s). It defaults to{}
, does nothing in except block and, doesnt get modified in_check_response
, and then has the headers/url added to it. So the 304 would just return a dict with the jikan_url and response headers (which I think is what we want).default_headers
to abstractjikan? That way if someone wants to set a User-Agent to identify themselves to api.jikan.moe. Then headers passed per request can override withdict.update
Not totally sure how to implement a 304 pytest, but I'll give it a try.
No Estimate currently on when I'll have this done.
The text was updated successfully, but these errors were encountered: