resty v2.1.0 Release Notes

Release Date: 2019-10-10 // about 1 month ago
  • 🚀 Release Notes

    ✨ Enhancements

    • ➕ Added support for func http.Request.GetBody, so request body manipalation can be done via PreRequestHook (such as adding Content-MD5 entity-header, etc) #242 @jeevatkm
    • ➕ Added SetCookie and SetCookies method added into Request object #257 @jeevatkm
    • ⚡️ Updated default JSON request content-type value without charset per RFC e.g., application/json #258 @jeevatkm
    • 🌲 Reducing memory allocation during debug log processing PR #277 @vivekv96
    • Code improvements @jeevatkm

    🐛 Bug Fixes


Previous changes from v2.0.0

  • 🚀 Release Notes

    How to use Resty v2?

    Please refer to README

    🆕 New Features

    ✨ 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
    • 0️⃣ Default values set while http.Transport creation simliar to Langauge default client #212 @jeevatkm
      • Timeout, KeepAlive, MaxIdleConns, IdleConnTimeout, TLSHandshakeTimeout, ExpectContinueTimeout, MaxIdleConnsPerHost
    • ➕ Added support to multipart/form-data payload without filename and content type values PR #236 @larryhu
    • ➕ Added HTTP verb PATCH into 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
    • PreRequestHook signature have been updated to func(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 Logger interface #229, refer to godoc @jeevatkm
    • Methods to accept type url.Values for Query string and Form data on Request struct #213 @jeevatkm
      • Refactored method from Request.SetMultiValueQueryParams to Request.SetQueryParamsFromValues
      • Refactored method from Request.SetMultiValueFormData to Request.SetFormDataFromValues