Help us shape the future of Go! Take the 2026 Go Developer Survey

httputil

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package httputil provides shared HTTP helper utilities used across multiple HTTP-facing packages (server, proxy, etc.).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteJSONResponse

func WriteJSONResponse(w http.ResponseWriter, statusCode int, body interface{})

WriteJSONResponse sets the Content-Type header, writes the status code, and encodes body as JSON. It centralises the three-line pattern used across HTTP handlers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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