httphead

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package helps parse http headers.

Index

Constants

This section is empty.

Variables

View Source
var ContentType = struct {
	ApplicationZip         string
	TextCsv                string
	TextPlain              string
	ApplicationOctetStream string
	ApplicationJSON        string
	MultipartFormData      string
}{
	"application/zip",
	"text/csv",
	"text/plain",
	"application/octet-stream",
	"application/json",
	"multipart/form-data",
}

ContentType describes "Content-Type"

Functions

func GetContentTypeByFileName

func GetContentTypeByFileName(name string) string

GetContentTypeByFileName returns "Content-Type" by file name

func HasContentType

func HasContentType(r *http.Request, mimetype string) bool

HasContentType determines whether the request `content-type` includes a server-acceptable mime-type

func HeaderAsMap added in v0.0.2

func HeaderAsMap(header http.Header) map[string]string

Types

This section is empty.

Jump to

Keyboard shortcuts

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