Browsing StarfallEx's section
โ† Back to ACE
Back to StarfallEx

SFEX.http.request

S๐Ÿท๏ธ Http

Part of StarfallEx namespace

๐Ÿ”— External
http.request(url, method, success, failed, body, parameters, type, headers, timeout)
View on GitHub|lua/starfall/libs_sh/http.lua:181
๐Ÿ“‹ Has LDoc๐Ÿ‘๏ธ 0 viewsUpdated 2 months ago

Description

Runs a new http request. Wraps HTTP() directly. Official documentation for each parameter can be found here: https://wiki.facepunch.com/gmod/Structures/HTTPRequest

Parameters

NameTypeDescription
urlstringHTTP resource URL
methodstringRequest method, case insensitive. Possible values are: GET, POST, HEAD, PUT, DELETE, PATCH, OPTIONS
success?functionFunction to be called on success, taking arguments code (number), body (string), and headers (table)
failed?functionFunction to be called on failure, taking argument reason (string)
body?stringBody string for POST data. If set, will override parameters
parameters?tableKeyValue table for URL parameters. This is only applicable to the following request methods: GET, POST (sent in body, so if body is set, parameters are ignored), and HEAD
type?stringContent type for body. (Default: "text/plain; charset=utf-8")
headers?tableKeyValue table for headers
timeout?numberThe timeout for the connection. Clamped between [0.1, 300]. (Default: 60)

Returns

No return values documented.

Examples

No examples available.

Used In

No usages found in the codebase.