httputils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is2xx

func Is2xx(status int) bool

Is2xx returns true if the provided status belongs to the 2xx family.

func UnmarshalBody

func UnmarshalBody(req *http.Request, target interface{}) error

UnmarshalBody reads the body of the given HTTP request and decodes it into the provided interface.

func Write

func Write(writer http.ResponseWriter, status int, headers map[string]string, body interface{})

Write writes the provided data as the HTTP response using the provided writer.

func WriteErr

func WriteErr(writer http.ResponseWriter, err error)

WriteErr writes the provided error as the HTTP response using the provided writer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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