-
Notifications
You must be signed in to change notification settings - Fork 1
melon.http
garryspins edited this page Feb 27, 2026
·
4 revisions
melon.http
HTTP wrapper that runs http requests when available
melon

melon.http.Generator(type: string) -> fn
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | type | string | Type of HTTP request, POST, HEAD, GET, ect |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | fn | fn | Function that calls the given request using [melon.HTTP] |
Generates a new function to create a request of the given type

melon.http.Get(url: string, onsuccess: fn, onfailure: fn, headers: table)
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | url | string | URL to make the request to |
| 2 | onsuccess | fn | Callback to run on success, gets same as http.Post |
| 3 | onfailure | fn | Callback to run on failure, gets same as http.Post |
| 4 | headers | table | URL to make the request to |
Make a GET request with melon.HTTP

melon.http.Head(url: string, onsuccess: fn, onfailure: fn, headers: table)
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | url | string | URL to make the request to |
| 2 | onsuccess | fn | Callback to run on success, gets same as http.Post |
| 3 | onfailure | fn | Callback to run on failure, gets same as http.Post |
| 4 | headers | table | URL to make the request to |
Make a HEAD request with melon.HTTP

melon.http.Post(url: string, onsuccess: fn, onfailure: fn, headers: table)
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | url | string | URL to make the request to |
| 2 | onsuccess | fn | Callback to run on success, gets same as http.Post |
| 3 | onfailure | fn | Callback to run on failure, gets same as http.Post |
| 4 | headers | table | URL to make the request to |
Make a POST request with melon.HTTP