httputil

package module
v0.0.0-...-9a9400b Latest Latest
Warning

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

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

README

Package httputil

The package github.com/heptalium/httputil contains helper functions for processing HTTP requests.

ParseRequest

ParseRequest parses HTTP requests into a struct. It supports POST form values and JSON encoded data as request. The request type is determined by the Content-Type header.

WriteHttpStatus

WriteHttpStatus replies to the HTTP request with the status code and a message consisting of the status code and the corresponding mes

Documentation

Overview

The package github.com/heptalium/httputil contains helper functions for processing HTTP requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRequest

func ParseRequest(w http.ResponseWriter, r *http.Request, data interface{}) error

ParseRequest parses HTTP requests into a struct. It supports POST form values and JSON encoded data as request. The request type is determined by the Content-Type header.

func WriteHttpStatus

func WriteHttpStatus(w http.ResponseWriter, status int)

WriteHttpStatus replies to the HTTP request with the status code and a message consisting of the status code and the corresponding message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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