Skip to main content

Response:getHeader()

Read one response header by name.

Signature​

getHeader(name: string): string

Parameters​

ParameterTypeDescription
namestringHeader name, case-insensitive

Returns

string - The header value, or nil when the response does not include it.

Example​

local response = Request("https://api.example.com/data"):get()
local type = response:getHeader("Content-Type")
toast("Server sent " .. (type or "no content type"))

Compatible Version: 1.0.0.37 and up