asmcos / requests Goto Github PK
View Code? Open in Web Editor NEWA golang HTTP client library. Salute to python requests.
License: Other
A golang HTTP client library. Salute to python requests.
License: Other
项目部维护了嘛,啥时候支持代理呀
Neat library, but I think you forgot to add a license :)
`func (resp *Response) Unmarshal(v interface{}) error {
if resp.content == nil {
resp.Content()
}
return json.Unmarshal(resp.content, v)
}
func (resp *Response) Json() (map[string]interface{}, error) {
var result = make(map[string]interface{})
if err := resp.Unmarshal(&result); err != nil {
return nil, err
}else {
return result, nil
}
}`
Please handle this possible error return appropriately:
Line 441 in b6ad2bd
client:= requests.Requests()
client.Post("https://www.httpbin.org/post",requests.Datas{"abc":"123","ddd":"789"})
resp,err:=client.Get("https://www.httpbin.org/get")
if err!= nil{
fmt.Println(err)
}
fmt.Println(resp.Text())
On Adnroid, must set dns, use system default will not work
dial tcp: lookup music.163.com on [::1]:53: read udp [::1]:39734->[::1]:53: read: connection refused
为什么会请求体会有多余的信息?
测试代码:
func httpPostJson() {
jsonStr := "{"name":"requests_post_test"}"
req := requests.Requests()
req.Proxy("http://127.0.0.1:8083")
resp, _ := req.PostJson("https://www.httpbin.org/post", jsonStr)
println(resp.Text())
}
Is there a knob equivalent to
requests.get('https://kennethreitz.com', verify=False)
to address this for test environments..
x509: certificate signed by unknown authority
post数据的时候只支持map类型的吗
使用requests.Requests() 创建了一个对象,并发的利用这个对象去发送请求是否会造成错误
python requests支持HTTPDigestAuth,请问go requests以后会更新支持吗?
how to fix this problem?
能否增加session支持,像requests.session(),自动处理客户端session的cookies
`
//reset Cookies,
//Client.Do can copy cookie from client.Jar to req.Header
delete(req.httpreq.Header, "Cookie")
`
源文件里面还专门去掉了..... 导致现在想要发送一个自定义cookie的 post 非常复杂, 不够优雅, 不够初衷了
`
req := requests.Requests()
cookie := &http.Cookie{
Name: "cooke_name",
Value: "cookie_value",
}
req.SetCookie(cookie)
header := requests.Header{
"content-type": "application/x-www-form-urlencoded",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36'",
}
payload := requests.Params{
"snatch": clean_number(amount),
"_token": _token,
"id": clean_number(id),
}
url_string := "https://......"
url_string = form_action
res, _ := req.Post(url_string, payload, header)`
Hi, what timeout is that? connection timeout? read timeout ? or summation of them?
Lines 230 to 233 in c839e8a
and if no timeout is specify, what is the default timeout?
http2: Transport: cannot retry err [http2: Transport received Server's graceful shutdown GOAWAY] after Request.Body was written; define Request.GetBody to avoid this error
Hello,I just Used your project as a dependency of my project: github.com/WAY29/gfuzz
maybe I need more feature such as:
Do you have a follow-up update plan?
Just a heads up that the code is not go-fmt
ed.
requests (master*) » go fmt requests.go requests_test.go
requests (master*) » git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: requests.go
modified: requests_test.go
在使用Header.Set设置 Content-Type 的参数为"multipart/form-data; boundary=xxx”后
在httpbin的返回结果中看到设置的参数没有生效,
可以指定boundary吗?
Try download large text , example huge json files, resp.Text() is incomplete. Is it possible to support stream parameter like in the python requests?
can we get history of request
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.