wnanbei / direwolf Goto Github PK
View Code? Open in Web Editor NEWPackage direwolf is a convenient and easy to use http client written in Golang.
Home Page: https://wnanbei.github.io/direwolf/
License: MIT License
Package direwolf is a convenient and easy to use http client written in Golang.
Home Page: https://wnanbei.github.io/direwolf/
License: MIT License
Post 表单只能设置[string]string
实际情况下有[string]int的情形
package main
import (
"fmt"
dw "github.com/wnanbei/direwolf"
)
func main() {
url := "https://blog.csdn.net/u013451157/article/details/78719374"
headers := dw.NewHeaders(
"User-Agent", "direwolf",
)
resp, err := dw.Get(url, headers)
if nil != err{
fmt.Println(err)
return
}
//fmt.Println(resp.Text())
fmt.Println(string(resp.Content()))
}
params := df.NewParams("aa", "bb")
resp, err := df.Get("https://httpbin.org/get?ss=sd",params)
if err != nil {
return
}
fmt.Println(resp.Text())
return
{
"args": {
"ss": "sd?aa=bb"
},
"headers": {
"Accept-Encoding": "gzip",
"Host": "httpbin.org",
"User-Agent": "direwolf - winter is coming"
},
"origin": "123.103.48.253, 123.103.48.253",
"url": "https://httpbin.org/get?ss=sd%3Faa=bb"
}
Seems like Params's bindRequest method not taking into account the fact that there are parameters on the url
RT..用于保存 下次登录
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.