rest

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeout = 30 * time.Second

Variables

View Source
var ErrUnexpectedStatusCode = errors.New("unexpected status code")

Functions

This section is empty.

Types

type Request

type Request struct {
	URL     string
	Method  string
	Headers map[string]string
	Body    string
	Timeout time.Duration
}

type Response

type Response struct {
	Status  string      `expr:"status"`
	Code    int         `expr:"code"`
	Body    string      `expr:"body"`
	Headers http.Header `expr:"headers"`
}

func SendRequest

func SendRequest(reqSpec *Request, validStatusCodes []int) (*Response, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL