'Getting a response status code with lua-request

How is it possible to get the response status code of a request using lua-http ? If that is not possible with it what module/library should i use ?



Solution 1:[1]

From the docs :

local http_request = require "http.request"
local headers, stream = assert(http_request.new_from_uri("http://example.com"):go())
print(headers:get ":status")

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kr3ypt0n