![]() |
ArkScript
A small, fast, functional and scripting language for video games
|
A module to play with HTTP requests, using cpp-httplib (MIT License).
Disclaimer: this module does not handle
Create a header map to use with the http client.
Parameters They work as pairs with:
name
: stringvalue
: stringReturn value UserType<httpHeaders>
Author
Example
Create a http client to query a server.
Parameters
Return value List
if the request succeeded: [status, body]
, otherwise nil
Author
Example
Get content from an online resource.
Parameters
client
: UserType<httpClient>
route
: stringheaders
: UserType<httpHeaders>
, optional, always come lastReturn value List
if the request succeeded: [status, body]
, otherwise nil
Author
Example
Make a POST / PUT / PATCH / DELETE request with a String as the request's body.
Parameters
client
: UserType<httpClient>
route
: stringbody
: string (request body)mimetype
: string, optional (defaults to text/plain
)headers
: UserType<httpHeaders>
, optional, always come lastReturn value List
if the request succeeded: [status, body]
, otherwise nil
Author
Example