The networking API would require the implementation of some extra classes (such as buffers and streams). I'd like for it to support TCP, WebSockets, and HTTP/S.
some basic examples for potential implementation:
response = http.get("https://example.com/")
.headers({ Authorization: "key" })
.send()
// <during request/response>
// The main thread isn't necessarily blocked here. I'd like for MiniScript
// to make the request off-thread, then join back to the main thread and
// resume execution of the program. This allows the user not to worry about
// any issues with threading.
print(response.text()) // -> string
print(response.json()) // -> dict | array
print(response.statusCode) // -> number
more to be established later
The networking API would require the implementation of some extra classes (such as buffers and streams). I'd like for it to support TCP, WebSockets, and HTTP/S.
some basic examples for potential implementation:
more to be established later