tengo icon indicating copy to clipboard operation
tengo copied to clipboard

Basic http

Open 0xor1 opened this issue 4 years ago • 3 comments

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

0xor1 avatar Jul 27 '21 09:07 0xor1

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?

0xor1 avatar Jul 27 '21 09:07 0xor1

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.

geseq avatar Sep 05 '21 00:09 geseq

can this be updated and merged?

tmm1 avatar Mar 27 '23 21:03 tmm1