Skip to content

Commit de0735f

Browse files
committed
readme update for release v2.1.0 and godoc update
1 parent 7a4c9b3 commit de0735f

File tree

3 files changed

+27
-57
lines changed

3 files changed

+27
-57
lines changed

README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<p align="center"><a href="#features">Features</a> section describes in detail about Resty capabilities</p>
55
</p>
66
<p align="center">
7-
<p align="center"><a href="https://travis-ci.org/go-resty/resty"><img src="https://travis-ci.org/go-resty/resty.svg?branch=master" alt="Build Status"></a> <a href="https://codecov.io/gh/go-resty/resty/branch/master"><img src="https://codecov.io/gh/go-resty/resty/branch/master/graph/badge.svg" alt="Code Coverage"></a> <a href="https://goreportcard.com/report/go-resty/resty"><img src="https://goreportcard.com/badge/go-resty/resty" alt="Go Report Card"></a> <a href="https://github.com/go-resty/resty/releases/latest"><img src="https://img.shields.io/badge/version-2.0.0-blue.svg" alt="Release Version"></a> <a href="https://godoc.org/github.com/go-resty/resty"><img src="https://godoc.org/github.com/go-resty/resty?status.svg" alt="GoDoc"></a> <a href="LICENSE"><img src="https://img.shields.io/github/license/go-resty/resty.svg" alt="License"></a></p>
7+
<p align="center"><a href="https://travis-ci.org/go-resty/resty"><img src="https://travis-ci.org/go-resty/resty.svg?branch=master" alt="Build Status"></a> <a href="https://codecov.io/gh/go-resty/resty/branch/master"><img src="https://codecov.io/gh/go-resty/resty/branch/master/graph/badge.svg" alt="Code Coverage"></a> <a href="https://goreportcard.com/report/go-resty/resty"><img src="https://goreportcard.com/badge/go-resty/resty" alt="Go Report Card"></a> <a href="https://github.com/go-resty/resty/releases/latest"><img src="https://img.shields.io/badge/version-2.1.0-blue.svg" alt="Release Version"></a> <a href="https://godoc.org/github.com/go-resty/resty"><img src="https://godoc.org/github.com/go-resty/resty?status.svg" alt="GoDoc"></a> <a href="LICENSE"><img src="https://img.shields.io/github/license/go-resty/resty.svg" alt="License"></a></p>
88
</p>
99
<p align="center">
1010
<h4 align="center">Resty Communication Channels</h4>
@@ -13,6 +13,7 @@
1313

1414
## News
1515

16+
* v2.1.0 [released](https://github.com/go-resty/resty/releases/tag/v2.1.0) and tagged on Oct 10, 2019.
1617
* v2.0.0 [released](https://github.com/go-resty/resty/releases/tag/v2.0.0) and tagged on Jul 16, 2019.
1718
* v1.12.0 [released](https://github.com/go-resty/resty/releases/tag/v1.12.0) and tagged on Feb 27, 2019.
1819
* 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).
@@ -21,9 +22,10 @@
2122

2223
* GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS, etc.
2324
* Simple and chainable methods for settings and request
24-
* Request Body can be `string`, `[]byte`, `struct`, `map`, `slice` and `io.Reader` too
25+
* [Request](https://godoc.org/github.com/go-resty/resty#Request) Body can be `string`, `[]byte`, `struct`, `map`, `slice` and `io.Reader` too
2526
* Auto detects `Content-Type`
2627
* Buffer less processing for `io.Reader`
28+
* Request Body can be read multiple times via `Request.RawRequest.GetBody()`
2729
* [Response](https://godoc.org/github.com/go-resty/resty#Response) object gives you more possibility
2830
* Access as `[]byte` array - `response.Body()` OR Access as `string` - `response.String()`
2931
* Know your `response.Time()` and when we `response.ReceivedAt()`
@@ -102,7 +104,7 @@ Resty author also published following projects for Go Community.
102104

103105
```bash
104106
# Go Modules
105-
require github.com/go-resty/resty/v2 v2.0.0
107+
require github.com/go-resty/resty/v2 v2.1.0
106108
```
107109

108110
## Usage
@@ -153,14 +155,14 @@ Error : <nil>
153155
Status Code: 200
154156
Status : 200 OK
155157
Time : 465.301137ms
156-
Received At: 2019-03-10 01:52:33.772456 -0800 PST m=+0.466672260
158+
Received At: 2019-06-16 01:52:33.772456 -0800 PST m=+0.466672260
157159
Body :
158160
{
159161
"args": {},
160162
"headers": {
161163
"Accept-Encoding": "gzip",
162164
"Host": "httpbin.org",
163-
"User-Agent": "go-resty/2.0.0-rc.1 (https://github.com/go-resty/resty)"
165+
"User-Agent": "go-resty/2.0.0 (https://github.com/go-resty/resty)"
164166
},
165167
"origin": "0.0.0.0",
166168
"url": "https://httpbin.org/get"

client.go

+10-26
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,6 @@ func (c *Client) SetCookieJar(jar http.CookieJar) *Client {
185185
// client.SetCookie(&http.Cookie{
186186
// Name:"go-resty",
187187
// Value:"This is cookie value",
188-
// Path: "/",
189-
// Domain: "sample.com",
190-
// MaxAge: 36000,
191-
// HttpOnly: true,
192-
// Secure: false,
193188
// })
194189
func (c *Client) SetCookie(hc *http.Cookie) *Client {
195190
c.Cookies = append(c.Cookies, hc)
@@ -198,27 +193,16 @@ func (c *Client) SetCookie(hc *http.Cookie) *Client {
198193

199194
// SetCookies method sets an array of cookies in the client instance.
200195
// These cookies will be added to all the request raised from this client instance.
201-
// cookies := make([]*http.Cookie, 0)
202-
//
203-
// cookies = append(cookies, &http.Cookie{
204-
// Name:"go-resty-1",
205-
// Value:"This is cookie 1 value",
206-
// Path: "/",
207-
// Domain: "sample.com",
208-
// MaxAge: 36000,
209-
// HttpOnly: true,
210-
// Secure: false,
211-
// })
212-
//
213-
// cookies = append(cookies, &http.Cookie{
214-
// Name:"go-resty-2",
215-
// Value:"This is cookie 2 value",
216-
// Path: "/",
217-
// Domain: "sample.com",
218-
// MaxAge: 36000,
219-
// HttpOnly: true,
220-
// Secure: false,
221-
// })
196+
// cookies := []*http.Cookie{
197+
// &http.Cookie{
198+
// Name:"go-resty-1",
199+
// Value:"This is cookie 1 value",
200+
// },
201+
// &http.Cookie{
202+
// Name:"go-resty-2",
203+
// Value:"This is cookie 2 value",
204+
// },
205+
// }
222206
//
223207
// // Setting a cookies into resty
224208
// client.SetCookies(cookies)

request.go

+10-26
Original file line numberDiff line numberDiff line change
@@ -470,11 +470,6 @@ func (r *Request) SetJSONEscapeHTML(b bool) *Request {
470470
// client.R().SetCookie(&http.Cookie{
471471
// Name:"go-resty",
472472
// Value:"This is cookie value",
473-
// Path: "/",
474-
// Domain: "sample.com",
475-
// MaxAge: 36000,
476-
// HttpOnly: true,
477-
// Secure: false,
478473
// })
479474
//
480475
// Note: Method appends the Cookie value into existing Cookie if already existing.
@@ -486,27 +481,16 @@ func (r *Request) SetCookie(hc *http.Cookie) *Request {
486481
}
487482

488483
// SetCookies method sets an array of cookies in the current request instance.
489-
// cookies := make([]*http.Cookie, 0)
490-
//
491-
// cookies = append(cookies, &http.Cookie{
492-
// Name:"go-resty-1",
493-
// Value:"This is cookie 1 value",
494-
// Path: "/",
495-
// Domain: "sample.com",
496-
// MaxAge: 36000,
497-
// HttpOnly: true,
498-
// Secure: false,
499-
// })
500-
//
501-
// cookies = append(cookies, &http.Cookie{
502-
// Name:"go-resty-2",
503-
// Value:"This is cookie 2 value",
504-
// Path: "/",
505-
// Domain: "sample.com",
506-
// MaxAge: 36000,
507-
// HttpOnly: true,
508-
// Secure: false,
509-
// })
484+
// cookies := []*http.Cookie{
485+
// &http.Cookie{
486+
// Name:"go-resty-1",
487+
// Value:"This is cookie 1 value",
488+
// },
489+
// &http.Cookie{
490+
// Name:"go-resty-2",
491+
// Value:"This is cookie 2 value",
492+
// },
493+
// }
510494
//
511495
// // Setting a cookies into resty's current request
512496
// client.R().SetCookies(cookies)

0 commit comments

Comments
 (0)