Remote is a Golang http request package to make request like POST GET PUT ... on a domain or an API
To install remote package, you need to install Go and set your Go workspace first.
- 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
- Import it in your code:
import "github.com/201R/remote"
- 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)
}
}