-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
ce8f330
commit 126aa82
Showing
2 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
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" | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters