Yuari
Documentation
Docs/HTTP/httpget

httpget

GET a URL and return the response body as a string.

Syntax

httpget(url: string, headers?: table) -> string

Parameters

ParameterTypeDescription
urlstringThe target URL.
headers?tableA table of request headers.

Returns

TypeDescription
stringBody

Description

httpget is part of the HTTP library. HTTP functions use the external WinHTTP client and return the raw response body or response table.

The operation is performed immediately using the arguments supplied at the call site.

The aliases HttpGet(url, headers?) resolve to the same implementation.

Example

local body = httpget("https://httpbin.org/get")
print(body)

Notes

  • Aliases: HttpGet(url, headers?).
  • HTTP requests are made through the external WinHTTP client.