libhttp

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package libhttp provides http related library functions.

Index

Constants

This section is empty.

Variables

View Source
var BasicRealm = "Authorization Required"

BasicRealm is used when setting the WWW-Authenticate response header.

Functions

func BasicAuthUnauthorized

func BasicAuthUnauthorized(w http.ResponseWriter, err error)

BasicAuthUnauthorized denies authentication.

func HandleErrorHTML

func HandleErrorHTML(w http.ResponseWriter, err error, statusCode int)

HandleErrorHTML wraps error in HTML.

func HandleErrorJson

func HandleErrorJson(w http.ResponseWriter, err error)

HandleErrorJson wraps error in JSON structure.

func ParseBasicAuth

func ParseBasicAuth(auth string) (username, password string, ok bool)

ParseBasicAuth parses an HTTP Basic Authentication string. "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" returns ("Aladdin", "open sesame", true).

Types

This section is empty.

Jump to

Keyboard shortcuts

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