accept

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package accept 用于处理 accpet 系列的报头

Deprecated: 已不在使用,请使用 qheader 包的相关内容

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accept

type Accept = qheader.Header

Accept 表示 Accept* 的报头元素

func Parse

func Parse(header string) ([]*Accept, error)

Parse 将报头内容解析为 []*Accept,并对内容进行排序之后返回。

排序方式如下:

Q 值大的靠前,如果 Q 值相同,则全名的比带通配符的靠前,*/* 最后。

q 值为 0 的数据将被过滤,比如:

application/*;q=0.1,application/xml;q=0.1,text/html;q=0

其中的 text/html 不会被返回,application/xml 的优先级会高于 application/*

Jump to

Keyboard shortcuts

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