Popularity
2.8
Growing
Activity
0.0
Stable
40
3
5
Programming language: Go
License: Apache License 2.0
Tags:
Utilities
Latest version: v0.0.1
rq alternatives and similar packages
Based on the "Utilities" category.
Alternatively, view rq alternatives based on common mentions on social networks and blogs.
-
项目文档
基于vite+vue3+gin搭建的开发基础平台(已完成setup语法糖版本),集成jwt鉴权,权限管理,动态路由,显隐可控组件,分页封装,多点登录拦截,资源权限,上传下载,代码生成器,表单生成器等开发必备功能。 -
excelize
Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets -
godotenv
A Go port of Ruby's dotenv library (Loads environment variables from `.env`.) -
gorequest
GoRequest -- Simplified HTTP client ( inspired by nodejs SuperAgent ) -
goreporter
A Golang tool that does static analysis, unit testing, code review and generate code quality report. -
go-funk
A modern Go utility library which provides helpers (map, find, contains, filter, ...) -
mc
MinIO Client is a replacement for ls, cp, mkdir, diff and rsync commands for filesystems and object storage. -
Kopia
Cross-platform backup tool for Windows, macOS & Linux with fast, incremental backups, client-side end-to-end encryption, compression and data deduplication. CLI and GUI included. -
spinner
Go (golang) package with 90 configurable terminal spinner/progress indicators. -
filetype
Fast, dependency-free Go package to infer binary file types based on the magic numbers header signature -
mole
CLI application to create ssh tunnels focused on resiliency and user experience. -
create-go-app
✨ Create a new production-ready project with backend, frontend and deploy automation by running one CLI command! -
boilr
:zap: boilerplate template manager that generates files or directories from template repositories -
beaver
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps. -
go-underscore
Helpfully Functional Go - A useful collection of Go utilities. Designed for programmer happiness. -
JobRunner
Framework for performing work asynchronously, outside of the request flow -
mimetype
A fast Golang library for media type and file extension detection, based on magic numbers
Less time debugging, more time building
Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.
Promo
scoutapm.com
Do you think we are missing an alternative of rq or a related project?
Popular Comparisons
README
rq

A nicer interface for golang stdlib HTTP client
Documents
Why?
Because golang HTTP client is a pain in the a...
Features
- Compatible with golang
http
stdlib:http.Request
,http.Response
andhttp.Cookie
- Step by step to build your request
- Better HTTP client
- Better cookie jar
- Import/export allow we save/transfer requests in JSON
- Default setting: example default
User-Agent
orAccept-Language
Installation
go get -u github.com/ddo/rq
Getting started
Simple
import "net/http"
import "github.com/ddo/rq"
r := rq.Get("https://httpbin.org/get")
// query https://httpbin.org/get?q=1&q=2&q=3&_=123456
r.Qs("q", "1", "2")
r.Qs("q", "3")
r.Qs("_", "123456")
// send with golang default HTTP client
res, err := http.DefaultClient.Do(r.ParseRequest())
defer res.Body.Close()
Custom client
In case you did not know that golang default http.Client
has no timeout.
use rq/client which has 180s
timeout by default
import "github.com/ddo/rq"
import "github.com/ddo/rq/client"
r := rq.Post("https://httpbin.org/post")
// query
r.Qs("_", "123456")
// Form
r.Send("data", "data value")
r.Send("extra", "extra value")
// use default rq client
// true to tell #Send to read all the response boby when return
data, res, err := client.Send(r, true)
// no need to close res.Body
// read = false -> you need to call res.Body when done reading
Headers
r := rq.Post("https://httpbin.org/post")
r.Set("Content-Type", "application/json")
r.Set("User-Agent", "ddo/rq")
Raw body
r := rq.Post("https://httpbin.org/post")
r.SendRaw(strings.NewReader("raw data binary or json"))
Client 
Default
// by default timeout = 3min
// no cookie jar
// and stops after 10 consecutive requests (10 redirects)
customClient := client.New(nil)
Custom Options
import "github.com/ddo/rq/client/jar"
cookieJar := jar.New()
// custom timeout = 10s and cookie jar
customClient := client.New(&Option{
Timeout: time.Second * 10,
jar: cookieJar,
})
Default settings
// set default User-Agent
defaultRq := rq.Get("")
defaultRq.Set("User-Agent", "github.com/ddo/rq")
customClient := client.New(&Option{
DefaultRq: defaultRq,
})
// from now all the requests called via this customClient
// gonna have the User-Agent header = "github.com/ddo/rq"
// if User-Agent header in request is not set
Redirect
- Default
client
stops after 10 consecutive requests - Or you can use
client.NoRedirect
to disable redirect
client.New(&Option{
CheckRedirect: client.NoCheckRedirect,
})
Cookies 
import "github.com/ddo/rq/client/jar"
cookieJar := jar.New()
customClient := client.New(&client.Option{
Jar: cookieJar,
})
// get all cookies by hostname
cookies, err := cookieJar.Get("httpbin.org")
// get a cookie by hostname and name
cookie, err := cookieJar.GetByName("httpbin.org", "cookiename").
// set cookies
err := cookieJar.Set("httpbin.org", cookies)
// set a cookie
err := cookieJar.SetOne("httpbin.org", cookie)
// clear the cookie jar
err := cookieJar.Clear("httpbin.org")
// delete a cookie by it's name
err := cookieJar.Delete("httpbin.org", "cookiename")
Debug
Set env DLOG=*
to enable logger to see request activities
TODO
List here #1