-
Notifications
You must be signed in to change notification settings - Fork 718
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version and readme update for v1.1 release
- Loading branch information
Showing
2 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# Resty [![Build Status](https://travis-ci.org/go-resty/resty.svg?branch=master)](https://travis-ci.org/go-resty/resty) [![codecov](https://codecov.io/gh/go-resty/resty/branch/master/graph/badge.svg)](https://codecov.io/gh/go-resty/resty/branch/master) [![GoReport](https://goreportcard.com/badge/go-resty/resty)](https://goreportcard.com/report/go-resty/resty) [![Version](https://img.shields.io/badge/version-1.0-blue.svg)](https://github.com/go-resty/resty/releases/latest) [![GoDoc](https://godoc.org/github.com/go-resty/resty?status.svg)](https://godoc.org/github.com/go-resty/resty) [![License](https://img.shields.io/github/license/go-resty/resty.svg)](LICENSE) | ||
# Resty [![Build Status](https://travis-ci.org/go-resty/resty.svg?branch=master)](https://travis-ci.org/go-resty/resty) [![codecov](https://codecov.io/gh/go-resty/resty/branch/master/graph/badge.svg)](https://codecov.io/gh/go-resty/resty/branch/master) [![GoReport](https://goreportcard.com/badge/go-resty/resty)](https://goreportcard.com/report/go-resty/resty) [![Version](https://img.shields.io/badge/version-1.1-blue.svg)](https://github.com/go-resty/resty/releases/latest) [![GoDoc](https://godoc.org/github.com/go-resty/resty?status.svg)](https://godoc.org/github.com/go-resty/resty) [![License](https://img.shields.io/github/license/go-resty/resty.svg)](LICENSE) | ||
|
||
Simple HTTP and REST client for Go inspired by Ruby rest-client. [Features](#features) section describes in detail about Resty capabilities. | ||
|
||
***v1.0 [released](https://github.com/go-resty/resty/releases/latest) and tagged on Sep 25, 2017.*** | ||
***v1.1 [released](https://github.com/go-resty/resty/releases/latest) and tagged on Jan 25, 2018.*** | ||
|
||
*Since Go v1.6 HTTP/2 & HTTP/1.1 protocol is used transparently. `Resty` works fine with HTTP/2 and HTTP/1.1.* | ||
|
||
|
@@ -24,6 +24,8 @@ Resty first version released on Sep 15, 2015 then it grew gradually as a very ha | |
- Success scenario [Request.SetResult()](https://godoc.org/github.com/go-resty/resty#Request.SetResult) and [Response.Result()](https://godoc.org/github.com/go-resty/resty#Response.Result). | ||
- Error scenario [Request.SetError()](https://godoc.org/github.com/go-resty/resty#Request.SetError) and [Response.Error()](https://godoc.org/github.com/go-resty/resty#Response.Error). | ||
* Easy to upload one or more file(s) via `multipart/form-data` | ||
* Auto detects file content type | ||
* Request URL [Path Params](https://godoc.org/github.com/go-resty/resty#Request.SetPathParams) | ||
* Backoff Retry Mechanism with retry condition function [reference](retry_test.go) | ||
* resty client HTTP & REST [Request](https://godoc.org/github.com/go-resty/resty#Client.OnBeforeRequest) and [Response](https://godoc.org/github.com/go-resty/resty#Client.OnAfterResponse) middlewares | ||
* `Request.SetContext` supported `go1.7` and above | ||
|
@@ -359,6 +361,20 @@ _, err := resty.R(). | |
Get("http://bit.ly/1LouEKr") | ||
``` | ||
|
||
#### Request URL Path Params | ||
Resty provides easy to use dynamic request URL path params. Params can be set at client and request level. Client level params value can be overridden at request level. | ||
|
||
```go | ||
resty.R().SetPathParams(map[string]string{ | ||
"userId": "[email protected]", | ||
"subAccountId": "100002", | ||
}). | ||
Get("/v1/users/{userId}/{subAccountId}/details") | ||
|
||
// Result: | ||
// Composed URL - /v1/users/[email protected]/100002/details | ||
``` | ||
|
||
#### Request and Response Middleware | ||
Resty provides middleware ability to manipulate for Request and Response. It is more flexible than callback approach. | ||
```go | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
package resty | ||
|
||
// Version # of resty | ||
const Version = "1.1-edge" | ||
const Version = "1.1" |