ax.reqwest¶
Thin wrapper around the reqwest binary module by William Venner.
Documented functions: 5 · Realm: shared
Functions¶
ax.reqwest:Get(url, onSuccess, onFailure, headers)ax.reqwest:Post(url, parameters, onSuccess, onFailure, headers)ax.reqwest:PostJSON(url, payload, onSuccess, onFailure, headers)ax.reqwest:Request(data)ax.reqwest:Send(method, url, body, contentType, onSuccess, onFailure, headers)
ax.reqwest:Get(url, onSuccess, onFailure, headers)¶
Performs a GET request.
Realm: shared
Parameters
| Name | Type | Description |
|---|---|---|
url |
string |
Target URL. |
Returns
boolean
Source: gamemode/framework/libraries/thirdparty/sh_reqwest.lua:78
ax.reqwest:Post(url, parameters, onSuccess, onFailure, headers)¶
Performs a POST request with urlencoded parameters.
Realm: shared
Parameters
| Name | Type | Description |
|---|---|---|
url |
string |
Target URL. |
Returns
boolean
Source: gamemode/framework/libraries/thirdparty/sh_reqwest.lua:96
ax.reqwest:PostJSON(url, payload, onSuccess, onFailure, headers)¶
Convenience helper for posting JSON-encoded payloads.
Realm: shared
Parameters
| Name | Type | Description |
|---|---|---|
url |
string |
Target URL. |
payload |
Any |
value that util.TableToJSON can encode, or a pre-encoded string. |
Returns
boolean
Source: gamemode/framework/libraries/thirdparty/sh_reqwest.lua:137
ax.reqwest:Request(data)¶
Dispatches a raw request table to the underlying reqwest function.
The table accepts every field supported by Garry's Mod's HTTP() plus the extras
introduced by reqwest (timeout, type, client certificates, etc.).
Realm: shared
Parameters
| Name | Type | Description |
|---|---|---|
data |
table |
Request table. |
Returns
boolean: True if the request was queued successfully.
Source: gamemode/framework/libraries/thirdparty/sh_reqwest.lua:55
ax.reqwest:Send(method, url, body, contentType, onSuccess, onFailure, headers)¶
Performs a request with a raw body (typically JSON).
Realm: shared
Parameters
| Name | Type | Description |
|---|---|---|
method |
string |
HTTP method (POST, PUT, PATCH, DELETE, ...). |
url |
string |
Target URL. |
body |
string |
Raw request body. |
Returns
boolean
Source: gamemode/framework/libraries/thirdparty/sh_reqwest.lua:117