tengo
tengo copied to clipboard
Basic http
adding the basic http client with byte limiting, doesn't allow for streaming requests, but should be good enough for most use cases. this is the matching change on the dry-er arg type checking.
basic usage:
fmt := import("fmt")
http := import("http")
res := http.do("GET", "http://example.test", {"my-header": "why not"}, bytes("this is the body"))
fmt.println(res.code == 200) // true
fmt.println(res.status == "200 OK") // true
fmt.println(len(res.headers) > 0) // map, true
fmt.println(len(res.body) > 0) // bytes, true
looks like it's failing because it's using go 1.13, I developed in go 1.16 any reason the project go version isn't keeping with latest go?
Unless we’re releasing a new major version I’d prefer this be backwards compatible with older Go versions, at least to a version or two before the current version at the time of the 2.0 release of tengo.
can this be updated and merged?