imroc / req

Simple Go HTTP client with Black Magic
https://req.cool
MIT License
4.12k stars 334 forks source link

Does req support passing context from outside? #319

Closed GingerMoon closed 6 months ago

GingerMoon commented 6 months ago

Does req support passing context from outside for setting timeout? eg. Client.R().Get(url, ctx)

Currently I use req.C().SetTimeout(2 * time.Second)

imroc commented 6 months ago

Yes, use SetContext at request level

GingerMoon commented 6 months ago

thanks!