Git Product home page Git Product logo

requests's People

Contributors

asmcos avatar buzhiyun avatar erjanmx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

requests's Issues

问题

post数据的时候只支持map类型的吗

是否是并发不安全的

使用requests.Requests() 创建了一个对象,并发的利用这个对象去发送请求是否会造成错误

How to set DNS

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

代理

项目部维护了嘛,啥时候支持代理呀

resp.Json()默认不传参,用法更符合requests

`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
}
}`

who is this?

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

Post请求中设置Content-Type没有生效

在使用Header.Set设置 Content-Type 的参数为"multipart/form-data; boundary=xxx”后
在httpbin的返回结果中看到设置的参数没有生效,
可以指定boundary吗?

New fetures

Hello,I just Used your project as a dependency of my project: github.com/WAY29/gfuzz
maybe I need more feature such as:

  • Sessions with Cookie Persistence
  • Custom requests method

Do you have a follow-up update plan?

what timeout

Hi, what timeout is that? connection timeout? read timeout ? or summation of them?

requests/requests.go

Lines 230 to 233 in c839e8a

// set timeout s = second
func (req *Request) SetTimeout(n time.Duration) {
req.Client.Timeout = time.Duration(n * time.Second)
}

and if no timeout is specify, what is the default timeout?

The code is not formatted correctly

Just a heads up that the code is not go-fmted.

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

http: ContentLength=N with Body length 0

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())

post方法为什么不支持实时插入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)`

Add a license

Neat library, but I think you forgot to add a license :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.