https://github.com/timschumi/gmod-chttp-utils
Wrapper functions and helpers for CHTTP
https://github.com/timschumi/gmod-chttp-utils
Last synced: about 2 months ago
JSON representation
Wrapper functions and helpers for CHTTP
- Host: GitHub
- URL: https://github.com/timschumi/gmod-chttp-utils
- Owner: timschumi
- License: mit
- Created: 2021-07-05T10:43:58.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-05-31T11:56:08.000Z (almost 2 years ago)
- Last Synced: 2025-01-26T17:48:08.125Z (4 months ago)
- Language: Lua
- Homepage:
- Size: 81.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chttp-utils
This plugin is available on the [Steam Workshop](https://steamcommunity.com/sharedfiles/filedetails/?id=2537802091).
This is a support library that provides additional functions and wrappers for my HTTP library,
[CHTTP](https://github.com/timschumi/gmod-chttp).Please note that installing the CHTTP module is still required.
If you like my work or otherwise profited from this addon, consider
[buying me a beer](https://paypal.me/schumact)!## Usage
chttp-utils isn't a normal module due to naming conflicts with the actual binary module.
Instead, it is a normal LUA file that should be included.```
-- Set this if you don't want to print any error messages when the module fails to load
-- (for example if you have your own messages or if you have fallback options).
CHTTP_SILENT = true-- This will provide a global `chttp` table providing all the functions.
-- The table will not be present if the module fails to load.
include("chttp.lua")
```The following functions will be available:
```
-- Behaves just like http.Fetch (https://wiki.facepunch.com/gmod/http.Fetch)
chttp.Fetch(url, onSuccess, onFailure, headers)-- Behaves just like http.Post (https://wiki.facepunch.com/gmod/http.Post)
chttp.Post(url, parameters, onSuccess, onFailure, headers)
```