request

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(r *Request) error

func WithBody

func WithBody(body []byte) Option

func WithHeader

func WithHeader(key, value string) Option

func WithJsonBody

func WithJsonBody(data any) Option

func WithMethod

func WithMethod(method string) Option

func WithRawUrl

func WithRawUrl(rawUrl string) Option

func WithUrl

func WithUrl(u *url.URL) Option

type Request

type Request struct {
	Method string
	Url    *url.URL
	Header http.Header
	Body   []byte
}

func New

func New(opts ...Option) (*Request, error)

func (*Request) LogValue

func (r *Request) LogValue() slog.Value

Jump to

Keyboard shortcuts

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