From 8b0e78cc917186b6285be7928a813fb89f88580c Mon Sep 17 00:00:00 2001 From: Jeevanandam M Date: Sun, 31 Oct 2021 15:23:40 -0700 Subject: [PATCH] For release v2.7.0 updates --- README.md | 25 ++++++++++++++++++++++--- go.mod | 2 +- go.sum | 4 ++-- resty.go | 2 +- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1b2b1b4d..f94e1ec7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

Features section describes in detail about Resty capabilities

-

Build Status Code Coverage Go Report Card Release Version GoDoc License Mentioned in Awesome Go

+

Build Status Code Coverage Go Report Card Release Version GoDoc License Mentioned in Awesome Go

Resty Communication Channels

@@ -13,7 +13,7 @@ ## News - * v2.6.0 [released](https://github.com/go-resty/resty/releases/tag/v2.6.0) and tagged on Apr 09, 2021. + * v2.7.0 [released](https://github.com/go-resty/resty/releases/tag/v2.7.0) and tagged on Nov 03, 2021. * v2.0.0 [released](https://github.com/go-resty/resty/releases/tag/v2.0.0) and tagged on Jul 16, 2019. * v1.12.0 [released](https://github.com/go-resty/resty/releases/tag/v1.12.0) and tagged on Feb 27, 2019. * v1.0 released and tagged on Sep 25, 2017. - Resty's first version was released on Sep 15, 2015 then it grew gradually as a very handy and helpful library. Its been a two years since first release. I'm very thankful to Resty users and its [contributors](https://github.com/go-resty/resty/graphs/contributors). @@ -36,6 +36,7 @@ - Success scenario [Request.SetResult()](https://pkg.go.dev/github.com/go-resty/resty/v2#Request.SetResult) and [Response.Result()](https://pkg.go.dev/github.com/go-resty/resty/v2#Response.Result). - Error scenario [Request.SetError()](https://pkg.go.dev/github.com/go-resty/resty/v2#Request.SetError) and [Response.Error()](https://pkg.go.dev/github.com/go-resty/resty/v2#Response.Error). - Supports [RFC7807](https://tools.ietf.org/html/rfc7807) - `application/problem+json` & `application/problem+xml` + * Resty provides an option to override [JSON Marshal/Unmarshal and XML Marshal/Unmarshal](#override-marshal-unmarshal) * Easy to upload one or more file(s) via `multipart/form-data` * Auto detects file content type * Request URL [Path Params (aka URI Params)](https://pkg.go.dev/github.com/go-resty/resty/v2#Request.SetPathParams) @@ -107,7 +108,7 @@ Resty author also published following projects for Go Community. ```bash # Go Modules -require github.com/go-resty/resty/v2 v2.6.0 +require github.com/go-resty/resty/v2 v2.7.0 ``` ## Usage @@ -359,6 +360,24 @@ resp, err := client.R(). Options("https://myapp.com/servers/nyc-dc-01") ``` +#### Override JSON & XML Marshal/Unmarshal + +User could register choice of JSON/XML library into resty or write your own. By default resty registers standard `encoding/json` and `encoding/xml` respectively. +```go +// Example of registering json-iterator +import jsoniter "github.com/json-iterator/go" + +json := jsoniter.ConfigCompatibleWithStandardLibrary + +client := resty.New() +client.JSONMarshal = json.Marshal +client.JSONUnmarshal = json.Unmarshal + +// similarly user could do for XML too with - +client.XMLMarshal +client.XMLUnmarshal +``` + ### Multipart File(s) upload #### Using io.Reader diff --git a/go.mod b/go.mod index d7576542..5e78bdc8 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/go-resty/resty/v2 -require golang.org/x/net v0.0.0-20210913180222-943fd674d43e +require golang.org/x/net v0.0.0-20211029224645-99673261e6eb go 1.11 diff --git a/go.sum b/go.sum index c94fa8f3..07a45152 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -golang.org/x/net v0.0.0-20210913180222-943fd674d43e h1:+b/22bPvDYt4NPDcy4xAGCmON713ONAWFeY3Z7I3tR8= -golang.org/x/net v0.0.0-20210913180222-943fd674d43e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211029224645-99673261e6eb h1:pirldcYWx7rx7kE5r+9WsOXPXK0+WH5+uZ7uPmJ44uM= +golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= diff --git a/resty.go b/resty.go index b09f5c21..6f9c8b4c 100644 --- a/resty.go +++ b/resty.go @@ -14,7 +14,7 @@ import ( ) // Version # of resty -const Version = "2.7.0-dev" +const Version = "2.7.0" // New method creates a new Resty client. func New() *Client {