https://github.com/wnanbei/direwolf
Package direwolf is a convenient and easy to use http client written in Golang.
https://github.com/wnanbei/direwolf
convenient golang http-client http-requests
Last synced: about 2 months ago
JSON representation
Package direwolf is a convenient and easy to use http client written in Golang.
- Host: GitHub
- URL: https://github.com/wnanbei/direwolf
- Owner: wnanbei
- License: mit
- Created: 2019-04-28T01:13:50.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-04-10T11:35:15.000Z (about 4 years ago)
- Last Synced: 2025-12-18T19:29:36.113Z (4 months ago)
- Topics: convenient, golang, http-client, http-requests
- Language: Go
- Homepage: https://wnanbei.github.io/direwolf/
- Size: 1.62 MB
- Stars: 41
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Direwolf HTTP Client: Save your time
[](https://travis-ci.org/wnanbei/direwolf)
[](https://codecov.io/gh/wnanbei/direwolf)



Package direwolf is a convenient and easy to use http client written in Golang.
If you want find more info, please go here: [Direwolf HTTP Client: Save your time](https://wnanbei.github.io/direwolf/),内有中文文档。

## Feature Support
- Clean and Convenient API
- Simple to Set Headers, Cookies, Parameters, Post Forms
- Sessions Control
- Keep-Alive & Connection Pooling
- HTTP(S) Proxy Support
- Redirect Control
- Timeout Control
- Support extract result from response body with css selector, regexp, json
- Content Decoding
- More to come...
## Installation
```text
go get github.com/wnanbei/direwolf
```
## Take a glance
You can easily send a request like this:
```go
import (
"fmt"
dw "github.com/wnanbei/direwolf"
)
func main() {
resp, err := dw.Get("https://www.google.com")
if err != nil {
return
}
fmt.Println(resp.Text())
}
```
Besides, direwolf provide a convenient way to add parameters to request. Such
as Headers, Cookies, Params, etc.
```go
import (
"fmt"
dw "github.com/wnanbei/direwolf"
)
func main() {
headers := dw.NewHeaders(
"User-Agent", "direwolf",
)
params := dw.NewParams(
"name", "wnanbei",
"age", "18",
)
cookies := dw.NewCookies(
"sign", "kzhxciuvyqwekhiuxcyvnkjdhiue",
)
resp, err := dw.Get("https://httpbin.org/get", headers, params, cookies)
if err != nil {
return
}
fmt.Println(resp.Text())
}
```
Output:
```json
{
"args": {
"age": "18",
"name": "wnanbei"
},
"headers": {
"Accept-Encoding": "gzip",
"Cookie": "sign=kzhxciuvyqwekhiuxcyvnkjdhiue",
"Host": "httpbin.org",
"User-Agent": "direwolf"
},
"origin": "1.1.1.1, 1.1.1.1",
"url": "https://httpbin.org/get?age=18&name=wnanbei"
}
```
## Contribute
Direwolf is a personal project now, but all contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome.
If you find a bug in direwolf or have some good ideas:
- Go to [GitHub “issues” tab](https://github.com/wnanbei/direwolf/issues) and open a fresh issue to start a discussion around a feature idea or a bug.
- Send a pull request and bug the maintainer until it gets merged and published.
- Write a test which shows that the bug was fixed or that the feature works as expected.
If you need to discuss about direwolf with me, you can send me a e-mail.