Package gorequests send http request with human style. for send GET request: for send POST request: for send http upload request for send json request request with timeout request with context request with no redirect
APACHE-2.0 License
Simple and easy-to-use go http client, supports cookies, streaming calls, custom logs and other functions
go get github.com/chyroc/gorequests
func 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)
}