Skip to content

hypnobrando/sendy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 builder pattern for constructing requests and parsing responses.

Quick Start

package main

import (
    "fmt"

    "github.com/hypnobrando/sendy"
)

type (
    User struct {
        ID   int    `json:"id"`
        Name string `json:"name"`
    }
)

func main() {
    var user User

    err := sendy.
        Get("https://myapi.com/users/1").
        SendIt().
        JSON(&user).
        Error()

    if err != nil {
        panic(err)
    }

    fmt.Println(user)
}

Installation / Usage

To install sendy, use go get:

go get github.com/hypnobrando/sendy

Import the hypnobrando/sendy package into your code:

import "github.com/hypnobrando/sendy"

func main() {
    httpClient := sendy.NewClient()
}

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!