mholt / curl-to-go

Convert curl commands to Go code in your browser

Home Page:https://mholt.github.io/curl-to-go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Do a request timeout

josephmilla opened this issue · comments

Whenever doing a call, request timeout should be done. Typically, this would be around 15,000ms

Maybe, use goreq instead? https://github.com/franela/goreq#user-content-setting-timeouts

Other timeout durations:
http://stackoverflow.com/questions/13582409/http-client-timeout-and-server-timeout

curl timeout:
http://unix.stackexchange.com/questions/94604/does-curl-have-a-timeout/94612

I still need to decide if it's the tool's job to create the http.Client that is used. Typically I let the programmer choose which http.Client to use because it's often reused in other code. The original scope for this tool was to help craft the http.Request, not so much the transport carrying it. But it's open for discussion.

I don't think at this point we should get into customizing the Client.