httpctype

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: MIT Imports: 1 Imported by: 14

Documentation

Overview

Package httpctype list some common http content-type

Index

Constants

View Source
const (
	CSS  = "text/css; charset=utf-8"
	HTML = "text/html; charset=utf-8"

	Text  = "text/plain; charset=utf-8" // equals Plain
	Plain = Text

	XML2 = "text/xml; charset=utf-8"
	XML  = "application/xml; charset=utf-8"

	YAML = "application/x-yaml; charset=utf-8"
	YML  = YAML

	JSON  = "application/json; charset=utf-8"
	JSONP = "application/javascript; charset=utf-8" // equals to JS

	JS  = "application/javascript; charset=utf-8"
	JS2 = "text/javascript; charset=utf-8"

	MSGPACK  = "application/x-msgpack; charset=utf-8"
	MSGPACK2 = "application/msgpack; charset=utf-8"

	PROTOBUF = "application/x-protobuf"

	Form = "application/x-www-form-urlencoded"
	// FormData for upload file
	FormData = "multipart/form-data"

	// Binary represents content type application/octet-stream
	Binary = "application/octet-stream"
)

there are some HTTP Content-Type with charset of the most common data formats.

View Source
const (
	KindForm     = "form"
	KindFormData = "dataForm"
	KindJSON     = "json"
	KindXML      = "xml"
)

there commonly base type category list

View Source
const (
	MIMEHTML  = "text/html"
	MIMEText  = "text/plain" // equals MIMEPlain
	MIMEPlain = "text/plain"
	MIMEJSON  = "application/json"
	MIMEXML   = "application/xml"
	MIMEXML2  = "text/xml"
	MIMEYAML  = "application/x-yaml"

	MIMEPOSTForm      = "application/x-www-form-urlencoded"
	MIMEMultiDataForm = "multipart/form-data"

	MIMEPROTOBUF = "application/x-protobuf"
	MIMEMSGPACK  = "application/x-msgpack"
	MIMEMSGPACK2 = "application/msgpack"
)

there are some Content-Type MIME of the most common data formats.

View Source
const Key = "Content-Type"

Variables

This section is empty.

Functions

func ToKind added in v0.6.8

func ToKind(cType, defaultType string) string

ToKind name match

Types

This section is empty.

Jump to

Keyboard shortcuts

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