Skip to main content

Response:getHeaders()

Read all response headers.

Signature​

getHeaders(): Map

Returns

Map - A read-only Java map of header names to values, with case-insensitive keys.

Description​

For one header, getHeader(name) is simpler. The map is useful when a macro needs to check several headers or pass them on; call its Java get() method with a header name.

Example​

local response = Request("https://api.example.com/data"):get()
local headers = response:getHeaders()
toast("Content-Type: " .. (headers:get("Content-Type") or "unknown"))

Compatible Version: 1.0.0.37 and up