modulepackage
0.0.0-20211005022609-05c16d44820e
Repository: https://github.com/nicksrandall/quest.git
Documentation: pkg.go.dev
# README
Quest
A request (http) library for Go with a convenient, chain-able API.
Errors
If any method in the request's life-cycle errors, the every subsequent method will short circut and not be called. The Done
method will return the first error that occured so that it can be handled.
Example
func GetUser(ctx context.Context, userId string) (user.User, error) {
var user user.User
err := quest.Post("/api/to/user/endpoint").
WitContext(ctx). // used for open tracing
QueryParam("includeDetails", "true").
JSONBody(userId).
Send().
ExpectSuccess().
GetJSON(&user).
Done()
return user, err
}
Open Tracing
- this library will work with Open Tracing
# Packages
No description provided by the author
# Functions
Delete creates a new http "Delete" request for path (uri).
Get creates a new http "GET" request for path (uri).
New creates a new request with given http method and path (uri).
Post creates a new http "POST" request for path (uri).
Put creates a new http "Put" request for path (uri).