Closed TheSerapher closed 5 years ago
LGTM
I just got an answer from the moneymoney support how to do it the right way
you have to set the Accept
header to application/json
then no exception is thrown, even if the api response code is 404. e.g.
local headers = {}
headers["Accept"] = "application/json"
local content = Connection():request("GET", url, nil, nil, headers)
return JSON(content):dictionary()
@TheSerapher having that information from @qoomon now, would you like to implement this differently, or leave it as it is?
I think instead of causing wild 404s and checking for headers and status codes, why not keep it as is and check if we should call it at all.
As requested, a quick fix for the current issue with unavailable currencies in the ticker.
Fixes #7