Skip to content
HTTP & JSON httpGetHeader

$httpGetHeader

Reads a header of the response of the most recent request made with $httpGet, $httpPost, $httpPut, $httpPatch, $httpDelete or $httpHead.

Syntax

$httpGetHeader[Key]

Parameters

Parameter Description
Key Required. The header name; the match ignores case. An empty name raises “HTTP header name cannot be empty.”.

Return value

  • The header value, or an empty string if the response does not have this header.
  • Without a preceding HTTP request, the error “A preceding HTTP request is required.” is raised.

Examples

$httpGet[https://example.com/api]
Content type: $httpGetHeader[content-type]

Try it

Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.