Skip to content
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

Additional timestamp queryparam causing issues with some APIs #200

Closed
nikhilraojl opened this issue Apr 1, 2024 · 2 comments · Fixed by #201
Closed

Additional timestamp queryparam causing issues with some APIs #200

nikhilraojl opened this issue Apr 1, 2024 · 2 comments · Fixed by #201
Milestone

Comments

@nikhilraojl
Copy link
Contributor

Expected Behavior

When using resting to call an API like https://api.openf1.org/v1/drivers?driver_number=1&session_key=9158, I expect to get a response with some json data, refer https://openf1.org/

Actual Behavior

Instead I just get an empty json array

Steps to Reproduce the Problem

  1. make a GET request to https://api.openf1.org/v1/drivers?driver_number=1&session_key=9158
  2. observe that the response is just an empty array

Possible fix

It seems that jquery adds an additional _ timestamp queryparam when using cache: false option to construct a ajax request in src/js/app/request.js/. jquery doc https://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings
Removing cache: false fixes this problem i.e I am getting proper response object instead of an empty array.

If this is fine as a fix I can make a PR

@mirkoperillo
Copy link
Owner

Hi @nikhilraojl.

I'm absolutely agree with you. Sometimes I have the same problem with some APIs.

It would be great to have a PR about it

@mirkoperillo
Copy link
Owner

@nikhilraojl I've just released the new version of Resting v1.9.1 with this fix.
Available both for Firefox and Chrome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants