httputil

package
v0.0.0-...-9fae4c4 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: MIT Imports: 4 Imported by: 2

Documentation

Overview

Package httputil provides HTTP utility functions, complementing the most common ones in package net/http.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindResponseWriter

func BindResponseWriter(w io.Writer, c *core.Context, before ...func([]byte))

BindResponseWriter catches a downstream response writing and transfer its content to the writer w (that will normally take care to use the original ResponseWriter). The before variadic is a set of functions that will be triggered just before writing the response.

func ResponseStatus

func ResponseStatus(w http.ResponseWriter) int

ResponseStatus returns the HTTP response status. Remember that the status is only set by the server after WriteHeader has been called.

func SetDetectedContentType

func SetDetectedContentType(w http.ResponseWriter, p []byte) string

SetDetectedContentType detects, sets and returns the response Conten-Type header value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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