aboutsummaryrefslogtreecommitdiff
path: root/docs/net
diff options
context:
space:
mode:
Diffstat (limited to 'docs/net')
-rw-r--r--docs/net/request.md29
-rw-r--r--docs/net/websocket.md4
2 files changed, 31 insertions, 2 deletions
diff --git a/docs/net/request.md b/docs/net/request.md
new file mode 100644
index 0000000..3d03d84
--- /dev/null
+++ b/docs/net/request.md
@@ -0,0 +1,29 @@
+## request
+
+net.request(url, content, header, request)**
+net.srequest(url, content, header, request)
+
+both function identically, where srequest uses https instead of http
+
+content is a string with the body of the request
+
+header is just a table
+
+request is just the request method, ie: GET, PUT, ...
+
+will call each other when the url protocol mismatches the function
+
+can return an error
+
+```lua
+local response = net.srequest("https://amyy.cc")
+```
+
+the response is a table consisting of the response headers with a few extra values
+
+|name|description|
+| -- | -- |
+| code | response code |
+| code-name | response code string |
+| version | http version |
+| content | a stream containing the body of the request |
diff --git a/docs/net/websocket.md b/docs/net/websocket.md
index 5a82a70..f64f80a 100644
--- a/docs/net/websocket.md
+++ b/docs/net/websocket.md
@@ -11,11 +11,11 @@ can return an error
```lua
net.wss("amyy.cc") -- connects to wss://amyy.cc
-net.wss("ws://amyy.cc") -- identical to net.wss("amyy.cc"
+net.wss("ws://amyy.cc") -- identical to net.wss("amyy.cc")
```
```lua
-local con = new.ws("amyy.cc")
+local con = net.ws("amyy.cc")
while true do
local frame = con:read()