项目作者: brandoneprice31

项目描述 :
A Go HTTP Builder Client.
高级语言: Go
项目地址: git://github.com/brandoneprice31/sendy.git
创建时间: 2020-05-07T02:34:10Z
项目社区:https://github.com/brandoneprice31/sendy

开源协议:MIT License

下载


sendy

godoc
License
Go Report Card

Go HTTP Client that prevents you from having to write boilerplate code setting up a native *http.Client, creating a request, and parsing the response. This package uses the @haluan/golang-builder-design-pattern-a8b7c92969a7">builder pattern for constructing requests and parsing responses.

Quick Start

  1. package main
  2. import (
  3. "fmt"
  4. "github.com/hypnobrando/sendy"
  5. )
  6. type (
  7. User struct {
  8. ID int `json:"id"`
  9. Name string `json:"name"`
  10. }
  11. )
  12. func main() {
  13. var user User
  14. err := sendy.
  15. Get("https://myapi.com/users/1").
  16. SendIt().
  17. JSON(&user).
  18. Error()
  19. if err != nil {
  20. panic(err)
  21. }
  22. fmt.Println(user)
  23. }

Installation / Usage

To install sendy, use go get:

  1. go get github.com/hypnobrando/sendy

Import the hypnobrando/sendy package into your code:

  1. import "github.com/hypnobrando/sendy"
  2. func main() {
  3. httpClient := sendy.NewClient()
  4. }

Staying Up to Date

To update sendy to the latest version, use go get -u github.com/hypnobrando/sendy.

Contributing

Please feel free to submit issues, fork the repository and send pull requests!