Buckaroo Banzai 126aa826bf
Add nic format option for json response (#17)
* add nic option config for json response and headers

* remove header stuff

Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
2021-06-06 17:21:31 +10:00

34 lines
565 B
Plaintext

How to use the NIC:
Send a digilines signal with the URL you want to download. The HTTPRequestResult table will be sent back on the same channel.
# Examples
## GET request with a plain url
```lua
-- request
digiline_send("nic", "http://example.com")
-- response
event.msg = {
code = 200,
succeeded = true,
data = "<html></html>"
}
```
## GET request with parsed json response
```lua
-- request
digiline_send("nic", {
url = "http://example.com",
parse_json = true
})
-- response
event.msg = {
code = 200,
succeeded = true,
data = {
my = "data"
}
}
```