A Go "clone" of the great and famous Requests library
grequestsrequestsgolanggolang-packagehttp-client
Key Metrics
Star Growth
Stars
2.2k
Forks
138
Weekly Growth
—
Issues
23
1k1.5k2k
Jun 2015Apr 2017Feb 2019Dec 2020Nov 2022Sep 2024Jul 2026
ArtifactsGo Modulesgo get github.com/levigross/grequests
README
GRequests
GRequests provides a clean wrapper around Go's net/http package. It mimics the convenience of the Python Requests library while keeping the power and safety of Go.
Features
Simple helpers for every HTTP verb
Context aware request functions for easy cancellation
RequestOptions for headers, query parameters, proxies, cookies and more
Built in support for JSON and XML responses
File uploads and convenient download helpers
Session type for reusing cookies between requests
Installation
go get github.com/levigross/grequests/v2
Quick start
package main
import (
"context"
"log"
"github.com/levigross/grequests/v2"
)
func main() {
resp, err := grequests.Get(context.Background(), "https://httpbin.org/get",
grequests.UserAgent("MyAgent"))
if err != nil {
log.Fatal(err)
}
var data map[string]any
if err := resp.JSON(&data); err != nil {
log.Fatal(err)
}
log.Println(data)
}