This example uses cjoudrey/gluahttp library for GopherLua.
See the output in browser developer console.
Actual code:
local http = require("http") local res, err = http.request('GET', 'https://httpbin.org/anything', { headers={ ['User-Agent']='gluahttp/wasm' } }) print(res.body)