I’m having a hard time understanding why Hugo would report a Not Found from a getJSON call on a URL that does return valid json (as verified using curl on the same computer and copy/paste the url from the Hugo error message)
The error message is:
Failed to retrieve remote file: Not Found
which I assume means that Hugo is getting a 404 from the server, but as I said the URL is fine.
The server is returning content-type: application/json
Perhaps Hugo is expecting a different content-type? (Clearly I’m grasping at straws here)
I’ve confirmed that the URL is returning a valid JSON array using this curl command: curl -s "https://4x7vplv094.execute-api.us-east-1.amazonaws.com/prod?tourney=Orleans%20Winter%20Open%202020" | jq '.[]|{p:.player.FirstAndLast,r:.odsaRating}'
Thanks for running that down. The 404 from wget is what set me down the right path to debugging the server. The server was in fact returning the correct data, but a 404 in the header rather than 200. my curl -s was masking that 404 which the wget was not.
The one suspicious thing I see is that the search term is “Orleans Winter Open 2020” with %20 meaning space int he URL. Maybe we found some kind of bug in a used URL parser that is choking on the %202020 part?
We don’t know what’s going on with the “tourney” parameter. if it’s some kind of tag or marker, try setting it up without spaces and see where this lands you.
The headers look ok, so it’s not some kind of authentication thing or routing/renaming. I would think the encoded special characters in the URL make some kind of problem in one of the used parts.
I’ve fixed the server that was returning 404 even after finding the appropriate data (a list of players for the "Orleans Winter Open 2020"squash tournament (hence the %20 values in the tourney parameter (I assumed that getJson didn’t url encode the parameters?)