Package ctype provides tools for working with the HTTP
Content-Type header, for the Go programming language.
- Go 100%
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| mediatype.go | ||
| mediatype_test.go | ||
| README.md | ||
go-ctype
Package ctype provides tools for working with the HTTP Content-Type header, for the Go programming language.
Documention
Online documentation, which includes examples, can be found at: http://godoc.org/codeberg.org/reiver/go-ctype
Example
Here is an example of getting the normalized media-type from a Content-Type.
import "codeberg.org/reiver/go-ctype"
// ...
contentType := response.Header.Get("Content-Type")
// contentType == "TEXT/HTML; charset=utf-8"
mediaType := ctype.MediaType(contentType)
// mediaType == "text/html"
Import
To import package ctype use import code like the following:
import "codeberg.org/reiver/go-ctype"
Installation
To install package ctype do the following:
GOPROXY=direct go get codeberg.org/reiver/go-ctype
Author
Package ctype was written by Charles Iliya Krempeaux