Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 1.17 KB

README.md

File metadata and controls

53 lines (37 loc) · 1.17 KB

Remote Go Reference License: MIT

Remote is a Golang http request package to make request like POST GET PUT ... on a domain or an API

Installation

To install remote package, you need to install Go and set your Go workspace first.

  1. The first need Go installed (version 1.12+ is required), then you can use the below Go command to install Gin.
$ go get -u github.com/201RichK/remote
  1. Import it in your code:
import "github.com/201R/remote"
  1. Quick start
# assume the following codes in example.go file
$ cat example.go
package main

import (
    "github.com/201R/remote"
    "fmt"
)

func main() {
    //Create new config 
    client := remote.NewRemote(remote.Config{})

    res, err := client.GET(remote.Options{
        URL: "https://google.com",
    })

    if err != nil {
        fmt.Println(err)
    }

    if err := json.NewDecoder(os.Stdout).Decode(res.Body); err != nil {
        fmt.Println(err)
    }
    
}