lastmaj/graphql-fpl

Possible solution for axios/fetch not working

tanayv opened this issue · 1 comments

Hey @lastmaj,

Thank you for creating this project, it's awesome for doing a lot of different types of analyses not possible on the app/FPL website. Just saw in the Readme that axios/fetch don't seem to work. I had ran into a similar issue while working on querying the FPL API from some scripts, and I found that we just have to supply a User-Agent header in the axios request, as outlined in this answer because the reason why this is needed is unclear: https://stackoverflow.com/questions/65140822/node-fetch-help-getting-fetcherror-invalid-json-response-body-at-url-reas

Happy to open a PR to switch to using axios/fetch depending on what you prefer if you don't have the bandwidth to do it right now as well.

Thanks!

Hello @tanayv
I am so happy that you found it useful. I am very interested to have a little chat over the type of analysis you do (twitter : @last_maj)
Thank you for opening this issue, as well as mentioning the fix. If you can (and want), open a PR. Otherwise I will try and fix it as soon as possible.
Thank you again !!