Skip to content

Commit ee6d790

Browse files
committed
Readme update for v0.5 release
1 parent 21fc3e3 commit ee6d790

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

README.md

+19-8
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
Simple HTTP and REST client for Go inspired by Ruby rest-client. Provides notable features - robust request body input, auto marshal & unmarshal, request and response middlewares, custom & extensible redirect policy (multiple policies can be applied), etc.
44

5+
***Latest v0.5 released on Jan 03, 2016.***
6+
57
#### Features
68
* Get, Post, Put, Delete, Head, Patch and Options
79
* Simple methods/chainable methods for settings and request
810
* Request Body can be `string`, `[]byte`, `struct` and `map`
911
* Auto detect `Content-Type`
1012
* Response object gives you more possibility
11-
* Access as `[]byte` array - `response.Body` OR Access as `string` - `response.String()`
12-
* Know your `response.Time()` and when we `response.ReceivedAt`
13+
* Access as `[]byte` array - `response.Body()` OR Access as `string` - `response.String()`
14+
* Know your `response.Time()` and when we `response.ReceivedAt()`
1315
* Have a look [godoc](https://godoc.org/github.com/go-resty/resty#Response)
1416
* Automatic marshal and unmarshal for `JSON` and `XML` content type
1517
* Default is `JSON`, if you supply `struct/map` without header `Content-Type`
@@ -44,7 +46,7 @@ resty tested with Go v1.2 and above.
4446
* etc.
4547

4648
## Installation
47-
#### Stable
49+
#### Stable - Versioning
4850
```sh
4951
go get gopkg.in/resty.v0
5052
```
@@ -72,7 +74,7 @@ fmt.Printf("\nResponse Status Code: %v", resp.StatusCode())
7274
fmt.Printf("\nResponse Status: %v", resp.Status())
7375
fmt.Printf("\nResponse Time: %v", resp.Time())
7476
fmt.Printf("\nResponse Recevied At: %v", resp.ReceivedAt())
75-
fmt.Printf("\nResponse Body: %v", resp)
77+
fmt.Printf("\nResponse Body: %v", resp) // or string(resp.Body())
7678
// more...
7779

7880
/* Output
@@ -384,24 +386,33 @@ if err != nil {
384386
resty.SetCertificates(cert1, cert2, cert3)
385387
```
386388

387-
#### Proxy Settings
389+
#### Proxy Settings - Client as well as at Request Level
388390
Default `Go` supports Proxy via environment variable `HTTP_PROXY`. Resty provides support via `SetProxy` & `RemoveProxy`.
389391
Choose as per your need.
392+
393+
**Client Level Proxy** settings applied to all the request
390394
```go
391395
// Setting a Proxy URL and Port
392396
resty.SetProxy("http://proxyserver:8888")
393397

394398
// Want to remove proxy setting
395399
resty.RemoveProxy()
396400
```
401+
**Request Level Proxy** settings, gives control to override at individal request level
402+
```go
403+
// Set proxy for current request
404+
resp, err := c.R().
405+
SetProxy("http://sampleproxy:8888").
406+
Get("http://httpbin.org/get")
407+
```
397408

398409
#### Choose REST or HTTP mode
399410
```go
411+
// REST mode. This is Default.
412+
resty.SetRESTMode()
413+
400414
// HTTP mode
401415
resty.SetHTTPMode()
402-
403-
// REST mode. Default one
404-
resty.SetRESTMode()
405416
```
406417

407418
#### Wanna Multiple Clients

0 commit comments

Comments
 (0)