httputil

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindJSON

func BindJSON(r *http.Request, v interface{}) error

BindJSON reads JSON from the request body and unmarshals it into the provided interface

func GetPathParam

func GetPathParam(r *http.Request, key string) string

GetPathParam extracts a path parameter from the URL using the new Go 1.22 pattern matching

func WriteJSON

func WriteJSON(w http.ResponseWriter, status int, v interface{}) error

WriteJSON marshals the provided interface to JSON and writes it to the response

Types

This section is empty.

Jump to

Keyboard shortcuts

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