Part of StarfallEx namespace
๐ External
http.request(url, method, success, failed, body, parameters, type, headers, timeout)๐ 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
| Name | Type | Description |
|---|---|---|
url | string | HTTP resource URL |
method | string | Request method, case insensitive. Possible values are: GET, POST, HEAD, PUT, DELETE, PATCH, OPTIONS |
success? | function | Function to be called on success, taking arguments code (number), body (string), and headers (table) |
failed? | function | Function to be called on failure, taking argument reason (string) |
body? | string | Body string for POST data. If set, will override parameters |
parameters? | table | KeyValue 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? | string | Content type for body. (Default: "text/plain; charset=utf-8") |
headers? | table | KeyValue table for headers |
timeout? | number | The 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.