Skip to content

Releases: xgfone/go-http-client

v0.19.2

20 Apr 08:02

Choose a tag to compare

  • Fixed:
    • Check response header to avoid decoding response body.

v0.19.1

20 Apr 07:58

Choose a tag to compare

  • Error implements the json.Marshaler interface to customize the json output.
  • Remove the xml struct tag from the Error type.
  • Fix bugs.

v0.19.0

20 Apr 07:55

Choose a tag to compare

  • Refactor the inner implementation.
  • Added:
    • Add the BaseURL, Do methods for Client.
    • Add the Doer interface instead of *http.Client.
  • Removed:
    • Remove the header constants.
    • Remove the ToError method from the Response type.
    • Remove the XxxJSON and XxxJSONContent functions, and use XxxContext instead.
    • Remove the unused Decoder type, and the CloseBody, GetContentType, NewRequestWithContext functions.
  • Changed:
    • The Hook interface returns a new error type argument.
    • Remove the first argument code from the NewError function signature.

v0.18.0

03 Apr 05:44

Choose a tag to compare

  • Remove the SetReqBodyEncoder method from Client and Request.
  • EncodeData supports to encode the type url.Values for application/x-www-form-urlencoded.

v0.17.1

07 Apr 01:41

Choose a tag to compare

  • Fixed:
    • Never escape html when encoding the request body by json.
    • Treat the request body as json raw message only if it is an object or array.

v0.17.0

02 Jan 03:59

Choose a tag to compare

  • New:
    • The default request body encoder EncodeData supports to encode the request body to application/x-www-form-urlencoded.
    • Add the method ReqBody for Response to return the original request body.
  • Fixed:
    • Fix a panic when failing to new http.Request.
    • Fix the request body buffer bug.
    • Retract the version v0.16.0.

v0.16.0

31 Dec 11:41

Choose a tag to compare

  • New:
    • Add the new method OnResponse to support the callback on the response result. For the default implementation, it will log the request information.

v0.15.0

31 Dec 11:37

Choose a tag to compare

  • Optimize the request body.

v0.14.0

31 Dec 11:36

Choose a tag to compare

  • New:
    • Support a function as the response result to customize the response body decoder.
    • Support to set a default response handler.
  • Others:
    • Use SetBodyEncoder instead of SetReqBodyEncoder.
    • The default response body decoder ignores the body if status code is equal to 204 or in [300, 400).

v0.13.0

31 Dec 11:28

Choose a tag to compare

Changed:

  • The functions, like XxxJSON, support to decode the response body.