Access External API in Lua

I want to access the API at api.rtt.io to get live train times.
I’ll need to apply a HTTPBasicAuth and also will need to apply gzip compression at the end, as referenced in the api documentation.
How can I access it? I have no idea at all ;-;