All Versions
9
Latest Version
Avg Release Cycle
466 days
Latest Release
-
Changelog History
Changelog History
-
v1.3.0 Changes
July 08, 2019 -
v1.2.0 Changes
November 18, 2018 -
v1.1.0 Changes
December 18, 2016- ๐ Allow JSON decoding, regardless of response Content-Type (#26)
- โ Add
BodyProvider
interface and setter so request Body encoding can be customized (#23) - โ Add
Doer
interface and setter so request sending behavior can be customized (#21) - โ Add
SetBasicAuth
setter for Authorization headers (#16) - โ Add Sling
Body
setter to set anio.Reader
on the Request (#9)
-
v1.0.0 Changes
- โ Added support for receiving and decoding error JSON structs
- ๐ Renamed Sling
JsonBody
setter toBodyJSON
(breaking) - ๐ Renamed Sling
BodyStruct
setter toBodyForm
(breaking) - ๐ Renamed Sling fields
httpClient
,method
,rawURL
, andheader
to be internal (breaking) - ๐ Changed
Do
andReceive
to skip response JSON decoding if "application/json" Content-Type is missing - ๐ Changed
Sling.Receive(v interface{})
toSling.Receive(successV, failureV interface{})
(breaking)- Previously
Receive
attempted to decode the response Body in all cases - Updated
Receive
will decode the response Body into successV for 2XX responses or decode the Body into failureV for other status codes. Pass a nilsuccessV
orfailureV
to skip JSON decoding into that value. - To upgrade, pass nil for the
failureV
argument or consider defining a JSON tagged struct appropriate for the API endpoint. (e.g.s.Receive(&issue, nil)
,s.Receive(&issue, &githubError)
) - To retain the old behavior, duplicate the first argument (e.g. s.Receive(&tweet, &tweet))
- Previously
- ๐ Changed
Sling.Do(http.Request, v interface{})
toSling.Do(http.Request, successV, failureV interface{})
(breaking)- See the changelog entry about
Receive
, the upgrade path is the same.
- See the changelog entry about
- โ Removed HEAD, GET, POST, PUT, PATCH, DELETE constants, no reason to export them (breaking)
-
v0.4.0 Changes
- ๐ Improved golint compliance
- ๐ Fixed typos and test printouts
-
v0.3.0 Changes
- โ Added BodyStruct method for setting a url encoded form body on the Request
- โ Added Add and Set methods for adding or setting Request Headers
- โ Added JsonBody method for setting JSON Request Body
- ๐ Improved examples and documentation
-
v0.2.0 Changes
- โ Added http.Client setter
- โ Added Sling.New() method to return a copy of a Sling
- โ Added Base setter and Path extension support
- โ Added method setters (Get, Post, Put, Patch, Delete, Head)
- โ Added support for encoding URL Query parameters
- โ Added example tiny Github API
- ๐ Changed v0.1.0 method signatures and names (breaking)
- โ Removed Go 1.0 support
-
v0.1.0 Changes
- ๐ Support decoding JSON responses.