Skip to content

jzero-io/restc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

restc

rest client for calling apis

example

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

func main() {
	restClient, err := NewClient("http://127.0.0.1:8080", WithRequestMiddleware(func(c Client, request *Request) error {
		request.AddHeader("test", "test")
		return nil
	}))

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

About

rest client for calling apis

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages