Perform HTTP requests
| Signature | hs.http.htmlEntities[] |
|---|---|
| Type | Variable |
| Description | A collection of common HTML Entities (&whatever;) and their UTF8 equivalents. To retrieve the UTF8 sequence for a given entity, reference the table as `hs.http.htmlEntities["&key;"]` where `key` is the text of the entity's name or a numeric reference like `#number`. |
| Notes | |
| Source | extensions/http/init.lua |
| Signature | hs.http.asyncGet(url, headers, callback) |
|---|---|
| Type | Function |
| Description | Sends an HTTP GET request asynchronously |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/http/init.lua |
| Signature | hs.http.asyncPost(url, data, headers, callback) |
|---|---|
| Type | Function |
| Description | Sends an HTTP POST request asynchronously |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/http/init.lua |
| Signature | hs.http.convertHtmlEntities(inString) -> outString |
|---|---|
| Type | Function |
| Description | Convert all recognized HTML Entities in the `inString` to appropriate UTF8 byte sequences and returns the converted text. |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/http/init.lua |
| Signature | hs.http.doAsyncRequest(url, method, data, headers, callback, [cachePolicy]) |
|---|---|
| Type | Function |
| Description | Creates an HTTP request and executes it asynchronously |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/http/internal.m |
| Signature | hs.http.doRequest(url, method, [data, headers, cachePolicy]) -> int, string, table |
|---|---|
| Type | Function |
| Description | Creates an HTTP request and executes it synchronously |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/http/internal.m |
| Signature | hs.http.encodeForQuery(string) -> string |
|---|---|
| Type | Function |
| Description | Returns a copy of the provided string in which characters that are not valid within an HTTP query key or value are escaped with their %## equivalent. |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/http/init.lua |
| Signature | hs.http.get(url, headers) -> int, string, table |
|---|---|
| Type | Function |
| Description | Sends an HTTP GET request to a URL |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/http/init.lua |
| Signature | hs.http.post(url, data, headers) -> int, string, table |
|---|---|
| Type | Function |
| Description | Sends an HTTP POST request to a URL |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/http/init.lua |
| Signature | hs.http.registerEntity(entity, codepoint) -> string |
|---|---|
| Type | Function |
| Description | Registers an HTML Entity with the specified Unicode codepoint which can later referenced in your code as `hs.http.htmlEntity[entity]` for convenience and readability. |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/http/init.lua |
| Signature | hs.http.urlParts(url) -> table |
|---|---|
| Type | Function |
| Description | Returns a table of keys containing the individual components of the provided url. |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/http/internal.m |