v2.0.0 Release
Release Notes
How to use Resty v2?
Please refer to README
New Features
- Dial a TCP connection from a specific Local Interface/IP Address #226 @jeevatkm
- On-Demand Resty Request/Responce tracer, #216 @jeevatkm, see TraceInfo, see Client.EnableTrace and see Request.EnableTrace - idea born from @moorereason example gist
- New
RetryAfterFuncaddition into Resty's retry capabilities PR #237 @neganovalexey, see RetryAfterFunc
Enhancements
- Build User-Agent string only once PR #221 @moorereason
- Retry Backoff algorthim and follow enhancement PR #237 @neganovalexey
- Log request and response debug log together for easy debugging, its highly helpful for parallel #218 @jeevatkm
- Default values set while
http.Transportcreation simliar to Langauge default client #212 @jeevatkm- Timeout, KeepAlive, MaxIdleConns, IdleConnTimeout, TLSHandshakeTimeout, ExpectContinueTimeout, MaxIdleConnsPerHost
- Added support to
multipart/form-datapayload without filename and content type values PR #236 @larryhu - Added HTTP verb
PATCHinto multipart support #239 @jeevatkm
Breaking Changes - Migrating v1.x to v2
- Resty v2 import path have changed to
github.com/go-resty/resty#215 @jeevatkm- Resty v1 import path is not affected.
- Resty Default Client approach have been removed. Create an instance of Resty client with appropriate settings for usage #232 @jeevatkm
PreRequestHooksignature have been updated tofunc(cl *Client, r *http.Request) error#217 @jeevatkm- Retry condition function signature updated to
RetryConditionFunc func(*Response, error) bool#237, #214 @neganovalexey, @jeevatkm - Resty v2 brings new
Loggerinterface #229, refer to godoc @jeevatkm - Methods to accept type
url.Valuesfor Query string and Form data on Request struct #213 @jeevatkm- Refactored method from
Request.SetMultiValueQueryParamstoRequest.SetQueryParamsFromValues - Refactored method from
Request.SetMultiValueFormDatatoRequest.SetFormDataFromValues
- Refactored method from