A Go "clone" of the great and famous Requests library
grequestsrequestsgolanggolang-packagehttp-client
주요 지표
스타 성장
스타
2.2k
포크
138
주간 성장
—
이슈
23
1k1.5k2k
2015년 6월2017년 4월2019년 2월2020년 12월2022년 11월2024년 9월2026년 7월
아티팩트Go 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)
}