Skip to content

Commit

Permalink
Improved code with Lint suggestion and readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevatkm committed Sep 30, 2015
1 parent e1a871f commit af2fa35
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# resty [![Build Status](https://travis-ci.org/go-resty/resty.svg?branch=master)](https://travis-ci.org/go-resty/resty) [![GoCover](http://gocover.io/_badge/github.com/go-resty/resty)](http://gocover.io/github.com/go-resty/resty) [![GoDoc](https://godoc.org/github.com/go-resty/resty?status.svg)](https://godoc.org/github.com/go-resty/resty) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Simple HTTP and REST client for Go inspired by Ruby rest-client.
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.

#### Features
* Get, Post, Put, Delete, Head, Patch and Options
Expand Down Expand Up @@ -33,7 +33,11 @@ Simple HTTP and REST client for Go inspired by Ruby rest-client.
resty tested with Go 1.2 and above.

#### Included Batteries
* Redirect Policies - NoRedirectPolicy, FlexibleRedirectPolicy, DomainCheckRedirectPolicy, etc. [more info](redirect.go)
* Redirect Policies
* NoRedirectPolicy
* FlexibleRedirectPolicy
* DomainCheckRedirectPolicy
* etc. [more info](redirect.go)
* Write Cookies to file from CookiesJar (upcoming)
* etc.

Expand Down
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,11 +475,11 @@ func (c *Client) SetTimeout(timeout time.Duration) *Client {
// Alternative: Without this `SetProxy` method, you can also set Proxy via environment variable.
// By default `Go` uses setting from `HTTP_PROXY`.
//
func (c *Client) SetProxy(proxyUrl string) *Client {
if pURL, err := url.Parse(proxyUrl); err == nil {
func (c *Client) SetProxy(proxyURL string) *Client {
if pURL, err := url.Parse(proxyURL); err == nil {
c.transport.Proxy = http.ProxyURL(pURL)
} else {
c.Log.Printf("ERROR: %s", err)
c.Log.Printf("ERROR: %v", err)
}

return c
Expand Down
4 changes: 2 additions & 2 deletions default.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ func SetTimeout(timeout time.Duration) *Client {
}

// SetProxy method sets Proxy for request. See Client.SetProxy for more information.
func SetProxy(proxyUrl string) *Client {
return DefaultClient.SetProxy(proxyUrl)
func SetProxy(proxyURL string) *Client {
return DefaultClient.SetProxy(proxyURL)
}

// RemoveProxy method removes the proxy configuration. See Client.RemoveProxy for more information.
Expand Down
2 changes: 1 addition & 1 deletion redirect.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"strings"
)

// RedirectPolicy to regulate the redirects in the resty client.
// Objects implementing the RedirectPolicy interface can be registered as
// RedirectPolicy to regulate the redirects in the resty.
//
// Apply function should return nil to continue the redirect jounery, otherwise
// return error to stop the redirect.
Expand Down
2 changes: 1 addition & 1 deletion resty.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Package resty provides simple HTTP and REST client for Go inspired by Ruby rest-
package resty

// go-resty version no
var Version = "0.1"
var Version = "0.2.1"

0 comments on commit af2fa35

Please sign in to comment.