126aa826bf
* add nic option config for json response and headers * remove header stuff Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
34 lines
565 B
Plaintext
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"
|
|
}
|
|
}
|
|
```
|