httputil

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: MIT Imports: 6 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, JSON encoded data and XML encoded 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, JSON encoded data and XML 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