Simple and easy-to-use go http client, supports cookies, streaming calls, custom logs and other functions
go get github.com/chyroc/gorequestsfunc main() {
text, err := gorequests.New(http.MethodGet, "https://jsonplaceholder.typicode.com/todos/1").Text()
if err != nil {
panic(err)
}
fmt.Println("text", text)
}func main() {
session := gorequests.NewSession("/tmp/gorequests-session.txt")
text, err := session.New(http.MethodGet, "https://jsonplaceholder.typicode.com/todos/1").Text()
if err != nil {
panic(err)
}
fmt.Println("text", text)
}func main() {
fac := gorequests.NewFactory(
gorequests.WithLogger(gorequests.NewDiscardLogger()),
)
text, err := fac.New(http.MethodGet, "https://jsonplaceholder.typicode.com/todos/1").Text()
if err != nil {
panic(err)
}
fmt.Println("text", text)
}