Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 398 Bytes

README.md

File metadata and controls

27 lines (21 loc) · 398 Bytes

restc

rest client for calling apis

example

package main
import (
	"context"
	
	"github.com/jzero-io/restc"
)

func main() {
	restClient, err := restc.New(restc.WithUrl("http://127.0.0.1:8080"))
	if err != nil {
		panic(err)
	}

	result := restClient.Get().SubPath("/api/v1/version").Do(context.Background())
	if result.Error() != nil {
		panic(err)
	}
	println(result.Status())
}