Documentation
¶
Index ¶
- Constants
- Variables
- func CopyHeaders(dst, src http.Header)
- func CopyTrailers(dst, src http.Header)
- func MatchMediaType(mt string, list []string) int
- func NewHandler(h http.Handler, ms ...ServerMiddleware) http.Handler
- func NewRoundTripper(rt http.RoundTripper, ms ...ClientMiddleware) http.RoundTripper
- func ParseHeader(s string) (values []string, params []map[string]string)
- func ParseQualifiedHeader(s string) (values []string, params []map[string]string)
- func ReadBody(r *http.Request) ([]byte, error)
- func RemoveHopByHopHeaders(h http.Header)
- func RewindBody(r *http.Request) error
- func ScanElement(s string) (elem, rest string)
- func SetForwardedHeaders(r *http.Request, h http.Header)
- func SetupRewindBody(r *http.Request) error
- type ClientMiddleware
- type ClientMiddlewareChain
- func (c *ClientMiddlewareChain) Add(ms ...ClientMiddleware)
- func (c *ClientMiddlewareChain) AfterAll(ms ...ClientMiddleware)
- func (c *ClientMiddlewareChain) BeforeAll(ms ...ClientMiddleware)
- func (c ClientMiddlewareChain) ClientMiddleware(next http.RoundTripper) http.RoundTripper
- func (c *ClientMiddlewareChain) Insert(index int, ms ...ClientMiddleware)
- func (c *ClientMiddlewareChain) InsertAll(ms ...ClientMiddleware)
- func (c ClientMiddlewareChain) RoundTripper(rt http.RoundTripper, ms ...ClientMiddleware) http.RoundTripper
- type ClientMiddlewareFunc
- type ErrorHandler
- type HTTPError
- type HandlerFunc
- type Proxy
- type ResponseWrapper
- func (w *ResponseWrapper) Flush()
- func (w *ResponseWrapper) FlushError() error
- func (w *ResponseWrapper) Header() http.Header
- func (w *ResponseWrapper) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (w *ResponseWrapper) StatusCode() int
- func (w *ResponseWrapper) Write(b []byte) (n int, err error)
- func (w *ResponseWrapper) WriteHeader(statusCode int)
- func (w *ResponseWrapper) Written() int64
- type RoundTripperFunc
- type ServerMiddleware
- type ServerMiddlewareChain
- func (c *ServerMiddlewareChain) Add(ms ...ServerMiddleware)
- func (c *ServerMiddlewareChain) AfterAll(ms ...ServerMiddleware)
- func (c *ServerMiddlewareChain) BeforeAll(ms ...ServerMiddleware)
- func (c ServerMiddlewareChain) Handler(h http.Handler, ms ...ServerMiddleware) http.Handler
- func (c *ServerMiddlewareChain) Insert(index int, ms ...ServerMiddleware)
- func (c *ServerMiddlewareChain) InsertAll(ms ...ServerMiddleware)
- func (c ServerMiddlewareChain) ServerMiddleware(next http.Handler) http.Handler
- type ServerMiddlewareFunc
- type ServerRunner
Examples ¶
Constants ¶
const ( HeaderAIM = "A-Im" // [RFC 3229: Delta encoding in HTTP] HeaderAccept = "Accept" // [RFC9110, Section 12.5.1: HTTP Semantics] HeaderAcceptAdditions = "Accept-Additions" // [RFC 2324: Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0)] HeaderAcceptCH = "Accept-Ch" // [RFC 8942, Section 3.1: HTTP Client Hints] HeaderAcceptCharset = "Accept-Charset" // [RFC9110, Section 12.5.2: HTTP Semantics] HeaderAcceptDatetime = "Accept-Datetime" // [RFC 7089: HTTP Framework for Time-Based Access to Resource States -- Memento] HeaderAcceptEncoding = "Accept-Encoding" // [RFC9110, Section 12.5.3: HTTP Semantics] HeaderAcceptFeatures = "Accept-Features" // [RFC 2295: Transparent Content Negotiation in HTTP] HeaderAcceptLanguage = "Accept-Language" // [RFC9110, Section 12.5.4: HTTP Semantics] HeaderAcceptPatch = "Accept-Patch" // [RFC 5789: PATCH Method for HTTP] HeaderAcceptPost = "Accept-Post" // [Linked Data Platform 1.0] HeaderAcceptRanges = "Accept-Ranges" // [RFC9110, Section 14.3: HTTP Semantics] HeaderAcceptSignature = "Accept-Signature" // [RFC 9421, Section 5.1: HTTP Message Signatures] HeaderAccessControl = "Access-Control" // [Access Control for Cross-site Requests] HeaderAccessControlAllowCredentials = "Access-Control-Allow-Credentials" // [Fetch] HeaderAccessControlAllowHeaders = "Access-Control-Allow-Headers" // [Fetch] HeaderAccessControlAllowMethods = "Access-Control-Allow-Methods" // [Fetch] HeaderAccessControlAllowOrigin = "Access-Control-Allow-Origin" // [Fetch] HeaderAccessControlExposeHeaders = "Access-Control-Expose-Headers" // [Fetch] HeaderAccessControlMaxAge = "Access-Control-Max-Age" // [Fetch] HeaderAccessControlRequestHeaders = "Access-Control-Request-Headers" // [Fetch] HeaderAccessControlRequestMethod = "Access-Control-Request-Method" // [Fetch] HeaderAge = "Age" // [RFC9111, Section 5.1: HTTP Caching] HeaderAllow = "Allow" // [RFC9110, Section 10.2.1: HTTP Semantics] HeaderALPN = "Alpn" // [RFC 7639, Section 2: The ALPN HTTP Header Field] HeaderAltSvc = "Alt-Svc" // [RFC 7838: HTTP Alternative Services] HeaderAltUsed = "Alt-Used" // [RFC 7838: HTTP Alternative Services] HeaderAlternates = "Alternates" // [RFC 2295: Transparent Content Negotiation in HTTP] HeaderAMPCacheTransform = "Amp-Cache-Transform" // [AMP-Cache-Transform HTTP request header] HeaderApplyToRedirectRef = "Apply-To-Redirect-Ref" // [RFC 4437: Web Distributed Authoring and Versioning (WebDAV) Redirect Reference Resources] HeaderAuthenticationControl = "Authentication-Control" // [RFC 8053, Section 4: HTTP Authentication Extensions for Interactive Clients] HeaderAuthenticationInfo = "Authentication-Info" // [RFC9110, Section 11.6.3: HTTP Semantics] HeaderAuthorization = "Authorization" // [RFC9110, Section 11.6.2: HTTP Semantics] HeaderAvailableDictionary = "Available-Dictionary" // [RFC-ietf-httpbis-compression-dictionary-19, Section 2.2: Compression Dictionary Transport] HeaderCExt = "C-Ext" // [RFC 2774: An HTTP Extension Framework] HeaderCMan = "C-Man" // [RFC 2774: An HTTP Extension Framework] HeaderCOpt = "C-Opt" // [RFC 2774: An HTTP Extension Framework] HeaderCPEP = "C-Pep" // [PEP - an Extension Mechanism for HTTP] HeaderCPEPInfo = "C-Pep-Info" // [PEP - an Extension Mechanism for HTTP] HeaderCacheControl = "Cache-Control" // [RFC9111, Section 5.2] HeaderCacheStatus = "Cache-Status" // [RFC9211: The Cache-Status HTTP Response Header Field] HeaderCalManagedID = "Cal-Managed-Id" // [RFC 8607, Section 5.1: Calendaring Extensions to WebDAV (CalDAV): Managed Attachments] HeaderCalDAVTimezones = "Caldav-Timezones" // [RFC 7809, Section 7.1: Calendaring Extensions to WebDAV (CalDAV): Time Zones by Reference] HeaderCapsuleProtocol = "Capsule-Protocol" // [RFC9297] HeaderCDNCacheControl = "Cdn-Cache-Control" // [RFC9213: Targeted HTTP Cache Control] HeaderCDNLoop = "Cdn-Loop" // [RFC 8586: Loop Detection in Content Delivery Networks (CDNs)] HeaderCertNotAfter = "Cert-Not-After" // [RFC 8739, Section 3.3: Support for Short-Term, Automatically Renewed (STAR) Certificates in the Automated Certificate Management Environment (ACME)] HeaderCertNotBefore = "Cert-Not-Before" // [RFC 8739, Section 3.3: Support for Short-Term, Automatically Renewed (STAR) Certificates in the Automated Certificate Management Environment (ACME)] HeaderClearSiteData = "Clear-Site-Data" // [Clear Site Data] HeaderClientCert = "Client-Cert" // [RFC9440, Section 2: Client-Cert HTTP Header Field] HeaderClientCertChain = "Client-Cert-Chain" // [RFC9440, Section 2: Client-Cert HTTP Header Field] HeaderClose = "Close" // [RFC9112, Section 9.6: HTTP/1.1] HeaderCMCDObject = "Cmcd-Object" // [CTA][CTA-5004 Common Media Client Data] HeaderCMCDRequest = "Cmcd-Request" // [CTA][CTA-5004 Common Media Client Data] HeaderCMCDSession = "Cmcd-Session" // [CTA][CTA-5004 Common Media Client Data] HeaderCMCDStatus = "Cmcd-Status" // [CTA][CTA-5004 Common Media Client Data] HeaderCMSDDynamic = "Cmsd-Dynamic" // [CTA][CTA-5006 Common Media Server Data (CMSD)] HeaderCMSDStatic = "Cmsd-Static" // [CTA][CTA-5006 Common Media Server Data (CMSD)] HeaderConcealedAuthExport = "Concealed-Auth-Export" // [RFC-ietf-httpbis-unprompted-auth-12: The Concealed HTTP Authentication Scheme] HeaderConfigurationContext = "Configuration-Context" // [OSLC Configuration Management Version 1.0. Part 3: Configuration Specification] HeaderConnection = "Connection" // [RFC9110, Section 7.6.1: HTTP Semantics] HeaderContentBase = "Content-Base" // [RFC 2068: Hypertext Transfer Protocol -- HTTP/1.1] HeaderContentDigest = "Content-Digest" // [RFC 9530, Section 2: Digest Fields] HeaderContentDisposition = "Content-Disposition" // [RFC 6266: Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP)] HeaderContentEncoding = "Content-Encoding" // [RFC9110, Section 8.4: HTTP Semantics] HeaderContentID = "Content-Id" // [The HTTP Distribution and Replication Protocol] HeaderContentLanguage = "Content-Language" // [RFC9110, Section 8.5: HTTP Semantics] HeaderContentLength = "Content-Length" // [RFC9110, Section 8.6: HTTP Semantics] HeaderContentLocation = "Content-Location" // [RFC9110, Section 8.7: HTTP Semantics] HeaderContentMD5 = "Content-Md5" // [RFC 2616, Section 14.15: Hypertext Transfer Protocol -- HTTP/1.1] HeaderContentRange = "Content-Range" // [RFC9110, Section 14.4: HTTP Semantics] HeaderContentScriptType = "Content-Script-Type" // [HTML 4.01 Specification] HeaderContentSecurityPolicy = "Content-Security-Policy" // [Content Security Policy Level 3] HeaderContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only" // [Content Security Policy Level 3] HeaderContentStyleType = "Content-Style-Type" // [HTML 4.01 Specification] HeaderContentType = "Content-Type" // [RFC9110, Section 8.3: HTTP Semantics] HeaderContentVersion = "Content-Version" // [RFC 2068: Hypertext Transfer Protocol -- HTTP/1.1] HeaderCookie = "Cookie" // [RFC 6265: HTTP State Management Mechanism] HeaderCookie2 = "Cookie2" // [RFC 2965: HTTP State Management Mechanism] HeaderCrossOriginEmbedderPolicy = "Cross-Origin-Embedder-Policy" // [HTML] HeaderCrossOriginEmbedderPolicyReportOnly = "Cross-Origin-Embedder-Policy-Report-Only" // [HTML] HeaderCrossOriginOpenerPolicy = "Cross-Origin-Opener-Policy" // [HTML] HeaderCrossOriginOpenerPolicyReportOnly = "Cross-Origin-Opener-Policy-Report-Only" // [HTML] HeaderCrossOriginResourcePolicy = "Cross-Origin-Resource-Policy" // [Fetch] HeaderCTACommonAccessToken = "Cta-Common-Access-Token" // [CTA][Chris_Lemmons] HeaderDASL = "Dasl" // [RFC 5323: Web Distributed Authoring and Versioning (WebDAV) SEARCH] HeaderDate = "Date" // [RFC9110, Section 6.6.1: HTTP Semantics] HeaderDAV = "Dav" // [RFC 4918: HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)] HeaderDefaultStyle = "Default-Style" // [HTML 4.01 Specification] HeaderDeltaBase = "Delta-Base" // [RFC 3229: Delta encoding in HTTP] HeaderDeprecation = "Deprecation" // [RFC-ietf-httpapi-deprecation-header-09, Section 2: The Deprecation HTTP Response Header Field] HeaderDepth = "Depth" // [RFC 4918: HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)] HeaderDerivedFrom = "Derived-From" // [RFC 2068: Hypertext Transfer Protocol -- HTTP/1.1] HeaderDestination = "Destination" // [RFC 4918: HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)] HeaderDifferentialID = "Differential-Id" // [The HTTP Distribution and Replication Protocol] HeaderDictionaryID = "Dictionary-Id" // [RFC-ietf-httpbis-compression-dictionary-19, Section 2.3: Compression Dictionary Transport] HeaderDigest = "Digest" // [RFC 3230: Instance Digests in HTTP] HeaderDPoP = "Dpop" // [RFC9449: OAuth 2.0 Demonstrating Proof of Possession (DPoP)] HeaderDPoPNonce = "Dpop-Nonce" // [RFC9449: OAuth 2.0 Demonstrating Proof of Possession (DPoP)] HeaderEarlyData = "Early-Data" // [RFC 8470: Using Early Data in HTTP] HeaderEDIINTFeatures = "Ediint-Features" // [RFC 6017: Electronic Data Interchange - Internet Integration (EDIINT) Features Header Field] HeaderETag = "Etag" // [RFC9110, Section 8.8.3: HTTP Semantics] HeaderExpect = "Expect" // [RFC9110, Section 10.1.1: HTTP Semantics] HeaderExpectCT = "Expect-Ct" // [RFC9163: Expect-CT Extension for HTTP] HeaderExpires = "Expires" // [RFC9111, Section 5.3: HTTP Caching] HeaderExt = "Ext" // [RFC 2774: An HTTP Extension Framework] HeaderForwarded = "Forwarded" // [RFC 7239: Forwarded HTTP Extension] HeaderFrom = "From" // [RFC9110, Section 10.1.2: HTTP Semantics] HeaderGetProfile = "Getprofile" // [Implementation of OPS Over HTTP] HeaderHobareg = "Hobareg" // [RFC 7486, Section 6.1.1: HTTP Origin-Bound Authentication (HOBA)] HeaderHost = "Host" // [RFC9110, Section 7.2: HTTP Semantics] HeaderHTTP2Settings = "Http2-Settings" // [RFC 7540, Section 3.2.1: Hypertext Transfer Protocol Version 2 (HTTP/2)] HeaderIf = "If" // [RFC 4918: HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)] HeaderIfMatch = "If-Match" // [RFC9110, Section 13.1.1: HTTP Semantics] HeaderIfModifiedSince = "If-Modified-Since" // [RFC9110, Section 13.1.3: HTTP Semantics] HeaderIfNoneMatch = "If-None-Match" // [RFC9110, Section 13.1.2: HTTP Semantics] HeaderIfRange = "If-Range" // [RFC9110, Section 13.1.5: HTTP Semantics] HeaderIfScheduleTagMatch = "If-Schedule-Tag-Match" // [ RFC 6338: Scheduling Extensions to CalDAV] HeaderIfUnmodifiedSince = "If-Unmodified-Since" // [RFC9110, Section 13.1.4: HTTP Semantics] HeaderIM = "Im" // [RFC 3229: Delta encoding in HTTP] HeaderIncludeReferredTokenBindingID = "Include-Referred-Token-Binding-Id" // [RFC 8473: Token Binding over HTTP] HeaderIsolation = "Isolation" // [OData Version 4.01 Part 1: Protocol][OASIS][Chet_Ensign] HeaderKeepAlive = "Keep-Alive" // [RFC 2068: Hypertext Transfer Protocol -- HTTP/1.1] HeaderLabel = "Label" // [RFC 3253: Versioning Extensions to WebDAV: (Web Distributed Authoring and Versioning)] HeaderLastEventID = "Last-Event-Id" // [HTML] HeaderLastModified = "Last-Modified" // [RFC9110, Section 8.8.2: HTTP Semantics] HeaderLink = "Link" // [RFC 8288: Web Linking] HeaderLinkTemplate = "Link-Template" // [RFC 9652: The Link-Template HTTP Header Field] HeaderLocation = "Location" // [RFC9110, Section 10.2.2: HTTP Semantics] HeaderLockToken = "Lock-Token" // [RFC 4918: HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)] HeaderMan = "Man" // [RFC 2774: An HTTP Extension Framework] HeaderMaxForwards = "Max-Forwards" // [RFC9110, Section 7.6.2: HTTP Semantics] HeaderMementoDatetime = "Memento-Datetime" // [RFC 7089: HTTP Framework for Time-Based Access to Resource States -- Memento] HeaderMeter = "Meter" // [RFC 2227: Simple Hit-Metering and Usage-Limiting for HTTP] HeaderMethodCheck = "Method-Check" // [Access Control for Cross-site Requests] HeaderMethodCheckExpires = "Method-Check-Expires" // [Access Control for Cross-site Requests] HeaderMIMEVersion = "Mime-Version" // [RFC9112, Appendix B.1: HTTP/1.1] HeaderNegotiate = "Negotiate" // [RFC 2295: Transparent Content Negotiation in HTTP] HeaderNEL = "Nel" // [Network Error Logging] HeaderODataEntityId = "Odata-Entityid" // [OData Version 4.01 Part 1: Protocol][OASIS][Chet_Ensign] HeaderODataIsolation = "Odata-Isolation" // [OData Version 4.01 Part 1: Protocol][OASIS][Chet_Ensign] HeaderODataMaxVersion = "Odata-Maxversion" // [OData Version 4.01 Part 1: Protocol][OASIS][Chet_Ensign] HeaderODataVersion = "Odata-Version" // [OData Version 4.01 Part 1: Protocol][OASIS][Chet_Ensign] HeaderOpt = "Opt" // [RFC 2774: An HTTP Extension Framework] HeaderOptionalWWWAuthenticate = "Optional-Www-Authenticate" // [RFC 8053, Section 3: HTTP Authentication Extensions for Interactive Clients] HeaderOrderingType = "Ordering-Type" // [RFC 3648: Web Distributed Authoring and Versioning (WebDAV) Ordered Collections Protocol] HeaderOrigin = "Origin" // [RFC 6454: The Web Origin Concept] HeaderOriginAgentCluster = "Origin-Agent-Cluster" // [HTML] HeaderOSCORE = "Oscore" // [RFC 8613, Section 11.1: Object Security for Constrained RESTful Environments (OSCORE)] HeaderOSLCCoreVersion = "Oslc-Core-Version" // [OASIS Project Specification 01][OASIS][Chet_Ensign] HeaderOverwrite = "Overwrite" // [RFC 4918: HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)] HeaderP3P = "P3p" // [The Platform for Privacy Preferences 1.0 (P3P1.0) Specification] HeaderPEP = "Pep" // [PEP - an Extension Mechanism for HTTP] HeaderPEPInfo = "Pep-Info" // [PEP - an Extension Mechanism for HTTP] HeaderPermissionsPolicy = "Permissions-Policy" // [Permissions Policy] HeaderPICSLabel = "Pics-Label" // [PICS Label Distribution Label Syntax and Communication Protocols] HeaderPingFrom = "Ping-From" // [HTML] HeaderPingTo = "Ping-To" // [HTML] HeaderPosition = "Position" // [RFC 3648: Web Distributed Authoring and Versioning (WebDAV) Ordered Collections Protocol] HeaderPragma = "Pragma" // [RFC9111, Section 5.4: HTTP Caching] HeaderPrefer = "Prefer" // [RFC 7240: Prefer Header for HTTP] HeaderPreferenceApplied = "Preference-Applied" // [RFC 7240: Prefer Header for HTTP] HeaderPriority = "Priority" // [RFC9218: Extensible Prioritization Scheme for HTTP] HeaderProfileObject = "Profileobject" // [Implementation of OPS Over HTTP] HeaderProtocol = "Protocol" // [PICS Label Distribution Label Syntax and Communication Protocols] HeaderProtocolInfo = "Protocol-Info" // [White Paper: Joint Electronic Payment Initiative] HeaderProtocolQuery = "Protocol-Query" // [White Paper: Joint Electronic Payment Initiative] HeaderProtocolRequest = "Protocol-Request" // [PICS Label Distribution Label Syntax and Communication Protocols] HeaderProxyAuthenticate = "Proxy-Authenticate" // [RFC9110, Section 11.7.1: HTTP Semantics] HeaderProxyAuthenticationInfo = "Proxy-Authentication-Info" // [RFC9110, Section 11.7.3: HTTP Semantics] HeaderProxyAuthorization = "Proxy-Authorization" // [RFC9110, Section 11.7.2: HTTP Semantics] HeaderProxyFeatures = "Proxy-Features" // [Notification for Proxy Caches] HeaderProxyInstruction = "Proxy-Instruction" // [Notification for Proxy Caches] HeaderProxyStatus = "Proxy-Status" // [RFC9209: The Proxy-Status HTTP Response Header Field] HeaderPublic = "Public" // [RFC 2068: Hypertext Transfer Protocol -- HTTP/1.1] HeaderPublicKeyPins = "Public-Key-Pins" // [RFC 7469: Public Key Pinning Extension for HTTP] HeaderPublicKeyPinsReportOnly = "Public-Key-Pins-Report-Only" // [RFC 7469: Public Key Pinning Extension for HTTP] HeaderRange = "Range" // [RFC9110, Section 14.2: HTTP Semantics] HeaderRedirectRef = "Redirect-Ref" // [RFC 4437: Web Distributed Authoring and Versioning (WebDAV) Redirect Reference Resources] HeaderReferer = "Referer" // [RFC9110, Section 10.1.3: HTTP Semantics] HeaderRefererRoot = "Referer-Root" // [Access Control for Cross-site Requests] HeaderReferrerPolicy = "Referrer-Policy" // [Referrer Policy] HeaderRefresh = "Refresh" // [HTML] HeaderRepeatabilityClientID = "Repeatability-Client-Id" // [Repeatable Requests Version 1.0][OASIS][Chet_Ensign] HeaderRepeatabilityFirstSent = "Repeatability-First-Sent" // [Repeatable Requests Version 1.0][OASIS][Chet_Ensign] HeaderRepeatabilityRequestID = "Repeatability-Request-Id" // [Repeatable Requests Version 1.0][OASIS][Chet_Ensign] HeaderRepeatabilityResult = "Repeatability-Result" // [Repeatable Requests Version 1.0][OASIS][Chet_Ensign] HeaderReplayNonce = "Replay-Nonce" // [RFC 8555, Section 6.5.1: Automatic Certificate Management Environment (ACME)] HeaderReportingEndpoints = "Reporting-Endpoints" // [Reporting API] HeaderReprDigest = "Repr-Digest" // [RFC 9530, Section 3: Digest Fields] HeaderRetryAfter = "Retry-After" // [RFC9110, Section 10.2.3: HTTP Semantics] HeaderSafe = "Safe" // [RFC 2310: The Safe Response Header Field] HeaderScheduleReply = "Schedule-Reply" // [RFC 6638: Scheduling Extensions to CalDAV] HeaderScheduleTag = "Schedule-Tag" // [RFC 6338: Scheduling Extensions to CalDAV] HeaderSecGPC = "Sec-Gpc" // [Global Privacy Control (GPC)] HeaderSecPurpose = "Sec-Purpose" // [Fetch] HeaderSecTokenBinding = "Sec-Token-Binding" // [RFC 8473: Token Binding over HTTP] HeaderSecWebSocketAccept = "Sec-Websocket-Accept" // [RFC 6455: The WebSocket Protocol] HeaderSecWebSocketExtensions = "Sec-Websocket-Extensions" // [RFC 6455: The WebSocket Protocol] HeaderSecWebSocketKey = "Sec-Websocket-Key" // [RFC 6455: The WebSocket Protocol] HeaderSecWebSocketProtocol = "Sec-Websocket-Protocol" // [RFC 6455: The WebSocket Protocol] HeaderSecWebSocketVersion = "Sec-Websocket-Version" // [RFC 6455: The WebSocket Protocol] HeaderSecurityScheme = "Security-Scheme" // [RFC 2660: The Secure HyperText Transfer Protocol] HeaderServer = "Server" // [RFC9110, Section 10.2.4: HTTP Semantics] HeaderServerTiming = "Server-Timing" // [Server Timing] HeaderSetCookie = "Set-Cookie" // [RFC 6265: HTTP State Management Mechanism] HeaderSetCookie2 = "Set-Cookie2" // [RFC 2965: HTTP State Management Mechanism] HeaderSetProfile = "Setprofile" // [Implementation of OPS Over HTTP] HeaderSignature = "Signature" // [RFC 9421, Section 4.2: HTTP Message Signatures] HeaderSignatureInput = "Signature-Input" // [RFC 9421, Section 4.1: HTTP Message Signatures] HeaderSLUG = "Slug" // [RFC 5023: The Atom Publishing Protocol] HeaderSoapAction = "Soapaction" // [Simple Object Access Protocol (SOAP) 1.1] HeaderStatusURI = "Status-Uri" // [RFC 2518: HTTP Extensions for Distributed Authoring -- WEBDAV] HeaderStrictTransportSecurity = "Strict-Transport-Security" // [RFC 6797: HTTP Strict Transport Security (HSTS)] HeaderSunset = "Sunset" // [RFC 8594: The Sunset HTTP Header Field] HeaderSurrogateCapability = "Surrogate-Capability" // [Edge Architecture Specification] HeaderSurrogateControl = "Surrogate-Control" // [Edge Architecture Specification] HeaderTCN = "Tcn" // [RFC 2295: Transparent Content Negotiation in HTTP] HeaderTE = "Te" // [RFC9110, Section 10.1.4: HTTP Semantics] HeaderTimeout = "Timeout" // [RFC 4918: HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)] HeaderTimingAllowOrigin = "Timing-Allow-Origin" // [Resource Timing Level 1] HeaderTopic = "Topic" // [RFC 8030, Section 5.4: Generic Event Delivery Using HTTP Push] HeaderTraceparent = "Traceparent" // [Trace Context] HeaderTracestate = "Tracestate" // [Trace Context] HeaderTrailer = "Trailer" // [RFC9110, Section 6.6.2: HTTP Semantics] HeaderTransferEncoding = "Transfer-Encoding" // [RFC9112, Section 6.1: HTTP Semantics] HeaderTTL = "Ttl" // [RFC 8030, Section 5.2: Generic Event Delivery Using HTTP Push] HeaderUpgrade = "Upgrade" // [RFC9110, Section 7.8: HTTP Semantics] HeaderUrgency = "Urgency" // [RFC 8030, Section 5.3: Generic Event Delivery Using HTTP Push] HeaderURI = "Uri" // [RFC 2068: Hypertext Transfer Protocol -- HTTP/1.1] HeaderUseAsDictionary = "Use-As-Dictionary" // [RFC-ietf-httpbis-compression-dictionary-19, Section 2.1: Compression Dictionary Transport] HeaderUserAgent = "User-Agent" // [RFC9110, Section 10.1.5: HTTP Semantics] HeaderVariantVary = "Variant-Vary" // [RFC 2295: Transparent Content Negotiation in HTTP] HeaderVary = "Vary" // [RFC9110, Section 12.5.5: HTTP Semantics] HeaderVia = "Via" // [RFC9110, Section 7.6.3: HTTP Semantics] HeaderWantContentDigest = "Want-Content-Digest" // [RFC 9530, Section 4: Digest Fields] HeaderWantDigest = "Want-Digest" // [RFC 3230: Instance Digests in HTTP] HeaderWantReprDigest = "Want-Repr-Digest" // [RFC 9530, Section 4: Digest Fields] HeaderWarning = "Warning" // [RFC9111, Section 5.5: HTTP Caching] HeaderWWWAuthenticate = "Www-Authenticate" // [RFC9110, Section 11.6.1: HTTP Semantics] HeaderXContentTypeOptions = "X-Content-Type-Options" // [Fetch] HeaderXFrameOptions = "X-Frame-Options" // [HTML] )
const ( MediaTypeApplication1dInterleavedParityfec = "application/1d-interleaved-parityfec" // [RFC6015] MediaTypeApplication3gpdashQoeReportXml = "application/3gpdash-qoe-report+xml" // [_3GPP][Ozgur_Oyman] MediaTypeApplication3gppHalJson = "application/3gppHal+json" // [_3GPP][Ulrich_Wiehe] MediaTypeApplication3gppHalFormsJson = "application/3gppHalForms+json" // [_3GPP][Ulrich_Wiehe] MediaTypeApplication3gppImsXml = "application/3gpp-ims+xml" // [_3GPP][John_M_Meredith] MediaTypeApplicationA2L = "application/A2L" // [ASAM][Thomas_Thomsen] MediaTypeApplicationAceGroupcommCbor = "application/ace-groupcomm+cbor" // [RFC9594] MediaTypeApplicationAceTrlCbor = "application/ace-trl+cbor" // [RFC-ietf-ace-revoked-token-notification-09] MediaTypeApplicationAceCbor = "application/ace+cbor" // [RFC9200] MediaTypeApplicationAceJson = "application/ace+json" // [RFC9431] MediaTypeApplicationActivemessage = "application/activemessage" // [Ehud_Shapiro] MediaTypeApplicationActivityJson = "application/activity+json" // [W3C][Benjamin_Goering] MediaTypeApplicationAifCbor = "application/aif+cbor" // [RFC9237] MediaTypeApplicationAifJson = "application/aif+json" // [RFC9237] MediaTypeApplicationAltoCdniJson = "application/alto-cdni+json" // [RFC9241] MediaTypeApplicationAltoCdnifilterJson = "application/alto-cdnifilter+json" // [RFC9241] MediaTypeApplicationAltoCostmapJson = "application/alto-costmap+json" // [RFC7285] MediaTypeApplicationAltoCostmapfilterJson = "application/alto-costmapfilter+json" // [RFC7285] MediaTypeApplicationAltoDirectoryJson = "application/alto-directory+json" // [RFC7285] MediaTypeApplicationAltoEndpointpropJson = "application/alto-endpointprop+json" // [RFC7285] MediaTypeApplicationAltoEndpointpropparamsJson = "application/alto-endpointpropparams+json" // [RFC7285] MediaTypeApplicationAltoEndpointcostJson = "application/alto-endpointcost+json" // [RFC7285] MediaTypeApplicationAltoEndpointcostparamsJson = "application/alto-endpointcostparams+json" // [RFC7285] MediaTypeApplicationAltoErrorJson = "application/alto-error+json" // [RFC7285] MediaTypeApplicationAltoNetworkmapfilterJson = "application/alto-networkmapfilter+json" // [RFC7285] MediaTypeApplicationAltoNetworkmapJson = "application/alto-networkmap+json" // [RFC7285] MediaTypeApplicationAltoPropmapJson = "application/alto-propmap+json" // [RFC9240] MediaTypeApplicationAltoPropmapparamsJson = "application/alto-propmapparams+json" // [RFC9240] MediaTypeApplicationAltoTipsJson = "application/alto-tips+json" // [RFC9569] MediaTypeApplicationAltoTipsparamsJson = "application/alto-tipsparams+json" // [RFC9569] MediaTypeApplicationAltoUpdatestreamcontrolJson = "application/alto-updatestreamcontrol+json" // [RFC8895] MediaTypeApplicationAltoUpdatestreamparamsJson = "application/alto-updatestreamparams+json" // [RFC8895] MediaTypeApplicationAML = "application/AML" // [ASAM][Thomas_Thomsen] MediaTypeApplicationAndrewInset = "application/andrew-inset" // [Nathaniel_Borenstein] MediaTypeApplicationApplefile = "application/applefile" // [Patrik_Faltstrom] MediaTypeApplicationAtJwt = "application/at+jwt" // [RFC9068] MediaTypeApplicationATF = "application/ATF" // [ASAM][Thomas_Thomsen] MediaTypeApplicationATFX = "application/ATFX" // [ASAM][Thomas_Thomsen] MediaTypeApplicationAtomXml = "application/atom+xml" // [RFC4287][RFC5023] MediaTypeApplicationAtomcatXml = "application/atomcat+xml" // [RFC5023] MediaTypeApplicationAtomdeletedXml = "application/atomdeleted+xml" // [RFC6721] MediaTypeApplicationAtomicmail = "application/atomicmail" // [Nathaniel_Borenstein] MediaTypeApplicationAtomsvcXml = "application/atomsvc+xml" // [RFC5023] MediaTypeApplicationAtscDwdXml = "application/atsc-dwd+xml" // [ATSC] MediaTypeApplicationAtscDynamicEventMessage = "application/atsc-dynamic-event-message" // [ATSC] MediaTypeApplicationAtscHeldXml = "application/atsc-held+xml" // [ATSC] MediaTypeApplicationAtscRdtJson = "application/atsc-rdt+json" // [ATSC] MediaTypeApplicationAtscRsatXml = "application/atsc-rsat+xml" // [ATSC] MediaTypeApplicationATXML = "application/ATXML" // [ASAM][Thomas_Thomsen] MediaTypeApplicationAuthPolicyXml = "application/auth-policy+xml" // [RFC4745] MediaTypeApplicationAutomationmlAmlXml = "application/automationml-aml+xml" // [AutomationML_e.V.] MediaTypeApplicationAutomationmlAmlxZip = "application/automationml-amlx+zip" // [AutomationML_e.V.] MediaTypeApplicationBacnetXddZip = "application/bacnet-xdd+zip" // [ASHRAE][Dave_Robin] MediaTypeApplicationBatchSMTP = "application/batch-SMTP" // [RFC2442] MediaTypeApplicationBeepXml = "application/beep+xml" // [RFC3080] MediaTypeApplicationBufr = "application/bufr" // [World_Meterological_Organization][Anna_Milan] MediaTypeApplicationC2pa = "application/c2pa" // [C2PA][Leonard_Rosenthol] MediaTypeApplicationCalendarJson = "application/calendar+json" // [RFC7265] MediaTypeApplicationCalendarXml = "application/calendar+xml" // [RFC6321] MediaTypeApplicationCallCompletion = "application/call-completion" // [RFC6910] MediaTypeApplicationCALS1840 = "application/CALS-1840" // [RFC1895] MediaTypeApplicationCaptiveJson = "application/captive+json" // [RFC8908] MediaTypeApplicationCbor = "application/cbor" // [RFC8949] MediaTypeApplicationCborSeq = "application/cbor-seq" // [RFC8742] MediaTypeApplicationCccex = "application/cccex" // [_3GPP] MediaTypeApplicationCcmpXml = "application/ccmp+xml" // [RFC6503] MediaTypeApplicationCcxmlXml = "application/ccxml+xml" // [RFC4267] MediaTypeApplicationCdaXml = "application/cda+xml" // [HL7][Marc_Duteau] MediaTypeApplicationCDFX_XML = "application/CDFX+XML" // [ASAM][Thomas_Thomsen] MediaTypeApplicationCdmiCapability = "application/cdmi-capability" // [RFC6208] MediaTypeApplicationCdmiContainer = "application/cdmi-container" // [RFC6208] MediaTypeApplicationCdmiDomain = "application/cdmi-domain" // [RFC6208] MediaTypeApplicationCdmiObject = "application/cdmi-object" // [RFC6208] MediaTypeApplicationCdmiQueue = "application/cdmi-queue" // [RFC6208] MediaTypeApplicationCdni = "application/cdni" // [RFC7736] MediaTypeApplicationCEA = "application/CEA" // [ASAM][Thomas_Thomsen] MediaTypeApplicationCea2018Xml = "application/cea-2018+xml" // [Gottfried_Zimmermann] MediaTypeApplicationCellmlXml = "application/cellml+xml" // [RFC4708] MediaTypeApplicationCfw = "application/cfw" // [RFC6230] MediaTypeApplicationCidEdhocCborSeq = "application/cid-edhoc+cbor-seq" // [RFC9528] MediaTypeApplicationCityJson = "application/city+json" // [OGC][Scott_Simmons] MediaTypeApplicationCityJsonSeq = "application/city+json-seq" // [OGC][Scott_Simmons] MediaTypeApplicationClr = "application/clr" // [IMS_Global][Andy_Miller] MediaTypeApplicationClue_infoXml = "application/clue_info+xml" // [RFC8846] MediaTypeApplicationClueXml = "application/clue+xml" // [RFC8847] MediaTypeApplicationCms = "application/cms" // [RFC7193] MediaTypeApplicationCnrpXml = "application/cnrp+xml" // [RFC3367] MediaTypeApplicationCoapGroupJson = "application/coap-group+json" // [RFC7390] MediaTypeApplicationCoapPayload = "application/coap-payload" // [RFC8075] MediaTypeApplicationCommonground = "application/commonground" // [David_Glazer] MediaTypeApplicationConciseProblemDetailsCbor = "application/concise-problem-details+cbor" // [RFC9290, Section 6.3] MediaTypeApplicationConferenceInfoXml = "application/conference-info+xml" // [RFC4575] MediaTypeApplicationCplXml = "application/cpl+xml" // [RFC3880] MediaTypeApplicationCose = "application/cose" // [RFC9052] MediaTypeApplicationCoseKey = "application/cose-key" // [RFC9052] MediaTypeApplicationCoseKeySet = "application/cose-key-set" // [RFC9052] MediaTypeApplicationCoseX509 = "application/cose-x509" // [RFC9360] MediaTypeApplicationCsrattrs = "application/csrattrs" // [RFC7030] MediaTypeApplicationCstaXml = "application/csta+xml" // [Ecma_International_Helpdesk] MediaTypeApplicationCSTAdataXml = "application/CSTAdata+xml" // [Ecma_International_Helpdesk] MediaTypeApplicationCsvmJson = "application/csvm+json" // [W3C][Ivan_Herman] MediaTypeApplicationCwl = "application/cwl" // [CWL_Project][Michael_R._Crusoe] MediaTypeApplicationCwlJson = "application/cwl+json" // [CWL_Project][Michael_R._Crusoe] MediaTypeApplicationCwlYaml = "application/cwl+yaml" // [CWL_Project][Michael_R._Crusoe] MediaTypeApplicationCwt = "application/cwt" // [RFC8392] MediaTypeApplicationCybercash = "application/cybercash" // [Donald_E._Eastlake_3rd] MediaTypeApplicationDashXml = "application/dash+xml" // [ISO-IEC_JTC_1][Thomas_Stockhammer] MediaTypeApplicationDashPatchXml = "application/dash-patch+xml" // [ISO-IEC_JTC_1] MediaTypeApplicationDashdelta = "application/dashdelta" // [David_Furbeck] MediaTypeApplicationDavmountXml = "application/davmount+xml" // [RFC4709] MediaTypeApplicationDcaRft = "application/dca-rft" // [Larry_Campbell] MediaTypeApplicationDCD = "application/DCD" // [ASAM][Thomas_Thomsen] MediaTypeApplicationDecDx = "application/dec-dx" // [Larry_Campbell] MediaTypeApplicationDialogInfoXml = "application/dialog-info+xml" // [RFC4235] MediaTypeApplicationDicom = "application/dicom" // [RFC3240] MediaTypeApplicationDicomJson = "application/dicom+json" // [DICOM_Standard_Committee][David_Clunie] MediaTypeApplicationDicomXml = "application/dicom+xml" // [DICOM_Standard_Committee][David_Clunie] MediaTypeApplicationDII = "application/DII" // [ASAM][Thomas_Thomsen] MediaTypeApplicationDIT = "application/DIT" // [ASAM][Thomas_Thomsen] MediaTypeApplicationDns = "application/dns" // [RFC4027] MediaTypeApplicationDnsJson = "application/dns+json" // [RFC8427] MediaTypeApplicationDnsMessage = "application/dns-message" // [RFC8484] MediaTypeApplicationDotsCbor = "application/dots+cbor" // [RFC9132] MediaTypeApplicationDpopJwt = "application/dpop+jwt" // [RFC9449] MediaTypeApplicationDskppXml = "application/dskpp+xml" // [RFC6063] MediaTypeApplicationDsscDer = "application/dssc+der" // [RFC5698] MediaTypeApplicationDsscXml = "application/dssc+xml" // [RFC5698] MediaTypeApplicationDvcs = "application/dvcs" // [RFC3029] MediaTypeApplicationEatCwt = "application/eat+cwt" // [RFC-ietf-rats-eat-media-type-12] MediaTypeApplicationEatJwt = "application/eat+jwt" // [RFC-ietf-rats-eat-media-type-12] MediaTypeApplicationEatBunCbor = "application/eat-bun+cbor" // [RFC-ietf-rats-eat-media-type-12] MediaTypeApplicationEatBunJson = "application/eat-bun+json" // [RFC-ietf-rats-eat-media-type-12] MediaTypeApplicationEatUcsCbor = "application/eat-ucs+cbor" // [RFC-ietf-rats-eat-media-type-12] MediaTypeApplicationEatUcsJson = "application/eat-ucs+json" // [RFC-ietf-rats-eat-media-type-12] MediaTypeApplicationEdhocCborSeq = "application/edhoc+cbor-seq" // [RFC9528] MediaTypeApplicationEDIConsent = "application/EDI-consent" // [RFC1767] MediaTypeApplicationEDIFACT = "application/EDIFACT" // [RFC1767] MediaTypeApplicationEDI_X12 = "application/EDI-X12" // [RFC1767] MediaTypeApplicationEfi = "application/efi" // [UEFI_Forum][Samer_El-Haj-Mahmoud] MediaTypeApplicationElmJson = "application/elm+json" // [HL7][Bryn_Rhodes] MediaTypeApplicationElmXml = "application/elm+xml" // [HL7][Bryn_Rhodes] MediaTypeApplicationEmergencyCallDataCapXml = "application/EmergencyCallData.cap+xml" // [RFC8876] MediaTypeApplicationEmergencyCallDataCommentXml = "application/EmergencyCallData.Comment+xml" // [RFC7852] MediaTypeApplicationEmergencyCallDataControlXml = "application/EmergencyCallData.Control+xml" // [RFC8147] MediaTypeApplicationEmergencyCallDataDeviceInfoXml = "application/EmergencyCallData.DeviceInfo+xml" // [RFC7852] MediaTypeApplicationEmergencyCallDataECallMSD = "application/EmergencyCallData.eCall.MSD" // [RFC8147] MediaTypeApplicationEmergencyCallDataLegacyESNJson = "application/EmergencyCallData.LegacyESN+json" // [NENA][Randall_Gellens] MediaTypeApplicationEmergencyCallDataProviderInfoXml = "application/EmergencyCallData.ProviderInfo+xml" // [RFC7852] MediaTypeApplicationEmergencyCallDataServiceInfoXml = "application/EmergencyCallData.ServiceInfo+xml" // [RFC7852] MediaTypeApplicationEmergencyCallDataSubscriberInfoXml = "application/EmergencyCallData.SubscriberInfo+xml" // [RFC7852] MediaTypeApplicationEmergencyCallDataVEDSXml = "application/EmergencyCallData.VEDS+xml" // [RFC8148][RFC Errata 6500] MediaTypeApplicationEmmaXml = "application/emma+xml" // [W3C][http://www.w3.org/TR/2007/CR-emma-20071211/#media-type-registration][ISO-IEC_JTC_1] MediaTypeApplicationEmotionmlXml = "application/emotionml+xml" // [W3C][Kazuyuki_Ashimura] MediaTypeApplicationEncaprtp = "application/encaprtp" // [RFC6849] MediaTypeApplicationEntityStatementJwt = "application/entity-statement+jwt" // [OpenID_Foundation_Artifact_Binding_WG] MediaTypeApplicationEppXml = "application/epp+xml" // [RFC5730] MediaTypeApplicationEpubZip = "application/epub+zip" // [W3C][EPUB_3_WG] MediaTypeApplicationEshop = "application/eshop" // [Steve_Katz] MediaTypeApplicationExample = "application/example" // [RFC4735] MediaTypeApplicationExi = "application/exi" // [W3C][http://www.w3.org/TR/2009/CR-exi-20091208/#mediaTypeRegistration] MediaTypeApplicationExpectCtReportJson = "application/expect-ct-report+json" // [RFC9163] MediaTypeApplicationExpress = "application/express" // [ISO-TC_184-SC_4][Dana_Tripp] MediaTypeApplicationFastinfoset = "application/fastinfoset" // [ITU-T_ASN.1_Rapporteur][ISO-IEC_JTC_1_SC_6_ASN.1_Rapporteur] MediaTypeApplicationFastsoap = "application/fastsoap" // [ITU-T_ASN.1_Rapporteur][ISO-IEC_JTC_1_SC_6_ASN.1_Rapporteur] MediaTypeApplicationFdf = "application/fdf" // [ISO-TC_171-SC_2][Betsy_Fanning] MediaTypeApplicationFdtXml = "application/fdt+xml" // [RFC6726] MediaTypeApplicationFhirJson = "application/fhir+json" // [HL7][Grahame_Grieve] MediaTypeApplicationFhirXml = "application/fhir+xml" // [HL7][Grahame_Grieve] MediaTypeApplicationFits = "application/fits" // [RFC4047] MediaTypeApplicationFlexfec = "application/flexfec" // [RFC8627] MediaTypeApplicationFontTdpfr = "application/font-tdpfr" // [RFC3073] MediaTypeApplicationFrameworkAttributesXml = "application/framework-attributes+xml" // [RFC6230] MediaTypeApplicationGeoJson = "application/geo+json" // [RFC7946] MediaTypeApplicationGeoJsonSeq = "application/geo+json-seq" // [RFC8142] MediaTypeApplicationGeopackageSqlite3 = "application/geopackage+sqlite3" // [OGC][Scott_Simmons] MediaTypeApplicationGeoposeJson = "application/geopose+json" // [OGC][Scott_Simmons] MediaTypeApplicationGeoxacmlJson = "application/geoxacml+json" // [OGC][Scott_Simmons] MediaTypeApplicationGeoxacmlXml = "application/geoxacml+xml" // [OGC][Scott_Simmons] MediaTypeApplicationGltfBuffer = "application/gltf-buffer" // [Khronos][Saurabh_Bhatia] MediaTypeApplicationGmlXml = "application/gml+xml" // [OGC][Clemens_Portele] MediaTypeApplicationGnapBindingJws = "application/gnap-binding-jws" // [RFC9635] MediaTypeApplicationGnapBindingJwsd = "application/gnap-binding-jwsd" // [RFC9635] MediaTypeApplicationGnapBindingRotationJws = "application/gnap-binding-rotation-jws" // [RFC9635] MediaTypeApplicationGnapBindingRotationJwsd = "application/gnap-binding-rotation-jwsd" // [RFC9635] MediaTypeApplicationGrib = "application/grib" // [World_Meterological_Organization][Anna_Milan] MediaTypeApplicationGzip = "application/gzip" // [RFC6713] MediaTypeApplicationH224 = "application/H224" // [RFC4573] MediaTypeApplicationHeldXml = "application/held+xml" // [RFC5985] MediaTypeApplicationHl7v2Xml = "application/hl7v2+xml" // [HL7][Marc_Duteau] MediaTypeApplicationHttp = "application/http" // [RFC9112] MediaTypeApplicationHyperstudio = "application/hyperstudio" // [Michael_Domino] MediaTypeApplicationIbeKeyRequestXml = "application/ibe-key-request+xml" // [RFC5408] MediaTypeApplicationIbePkgReplyXml = "application/ibe-pkg-reply+xml" // [RFC5408] MediaTypeApplicationIbePpData = "application/ibe-pp-data" // [RFC5408] MediaTypeApplicationIges = "application/iges" // [Curtis_Parks] MediaTypeApplicationImIscomposingXml = "application/im-iscomposing+xml" // [RFC3994] MediaTypeApplicationIndex = "application/index" // [RFC2652] MediaTypeApplicationIndexCmd = "application/index.cmd" // [RFC2652] MediaTypeApplicationIndexObj = "application/index.obj" // [RFC2652] MediaTypeApplicationIndexResponse = "application/index.response" // [RFC2652] MediaTypeApplicationIndexVnd = "application/index.vnd" // [RFC2652] MediaTypeApplicationInkmlXml = "application/inkml+xml" // [Kazuyuki_Ashimura] MediaTypeApplicationIOTP = "application/IOTP" // [RFC2935] MediaTypeApplicationIpfix = "application/ipfix" // [RFC5655] MediaTypeApplicationIpp = "application/ipp" // [RFC8010] MediaTypeApplicationISUP = "application/ISUP" // [RFC3204] MediaTypeApplicationItsXml = "application/its+xml" // [W3C][ITS-IG-W3C] MediaTypeApplicationJavaArchive = "application/java-archive" // [JCP][Iris_Clark] MediaTypeApplicationJf2feedJson = "application/jf2feed+json" // [W3C][Ivan_Herman] MediaTypeApplicationJose = "application/jose" // [RFC7515] MediaTypeApplicationJoseJson = "application/jose+json" // [RFC7515] MediaTypeApplicationJrdJson = "application/jrd+json" // [RFC7033] MediaTypeApplicationJscalendarJson = "application/jscalendar+json" // [RFC8984] MediaTypeApplicationJscontactJson = "application/jscontact+json" // [RFC9553] MediaTypeApplicationJson = "application/json" // [RFC8259] MediaTypeApplicationJsonPatchJson = "application/json-patch+json" // [RFC6902] MediaTypeApplicationJsonSeq = "application/json-seq" // [RFC7464] MediaTypeApplicationJsonpath = "application/jsonpath" // [RFC9535] MediaTypeApplicationJwkJson = "application/jwk+json" // [RFC7517] MediaTypeApplicationJwkSetJson = "application/jwk-set+json" // [RFC7517] MediaTypeApplicationApplicationJwkSetJwt = "application/jwk-set+jwt" // [OpenID_Foundation_Artifact_Binding_WG] MediaTypeApplicationJwt = "application/jwt" // [RFC7519] MediaTypeApplicationKpmlRequestXml = "application/kpml-request+xml" // [RFC4730] MediaTypeApplicationKpmlResponseXml = "application/kpml-response+xml" // [RFC4730] MediaTypeApplicationLdJson = "application/ld+json" // [W3C][Ivan_Herman] MediaTypeApplicationLgrXml = "application/lgr+xml" // [RFC7940] MediaTypeApplicationLinkFormat = "application/link-format" // [RFC6690] MediaTypeApplicationLinkset = "application/linkset" // [RFC9264] MediaTypeApplicationLinksetJson = "application/linkset+json" // [RFC9264] MediaTypeApplicationLoadControlXml = "application/load-control+xml" // [RFC7200] MediaTypeApplicationLogoutJwt = "application/logout+jwt" // [OpenID_Foundation_Artifact_Binding_WG] MediaTypeApplicationLostXml = "application/lost+xml" // [RFC5222] MediaTypeApplicationLostsyncXml = "application/lostsync+xml" // [RFC6739] MediaTypeApplicationLpfZip = "application/lpf+zip" // [W3C][Ivan_Herman] MediaTypeApplicationLXF = "application/LXF" // [ASAM][Thomas_Thomsen] MediaTypeApplicationMacBinhex40 = "application/mac-binhex40" // [Patrik_Faltstrom] MediaTypeApplicationMacwriteii = "application/macwriteii" // [Paul_Lindner] MediaTypeApplicationMadsXml = "application/mads+xml" // [RFC6207] MediaTypeApplicationManifestJson = "application/manifest+json" // [W3C][Marcos_Caceres] MediaTypeApplicationMarc = "application/marc" // [RFC2220] MediaTypeApplicationMarcxmlXml = "application/marcxml+xml" // [RFC6207] MediaTypeApplicationMathematica = "application/mathematica" // [Wolfram] MediaTypeApplicationMathmlXml = "application/mathml+xml" // [W3C][http://www.w3.org/TR/MathML3/appendixb.html] MediaTypeApplicationMathmlContentXml = "application/mathml-content+xml" // [W3C][http://www.w3.org/TR/MathML3/appendixb.html] MediaTypeApplicationMathmlPresentationXml = "application/mathml-presentation+xml" // [W3C][http://www.w3.org/TR/MathML3/appendixb.html] MediaTypeApplicationMbmsAssociatedProcedureDescriptionXml = "application/mbms-associated-procedure-description+xml" // [_3GPP] MediaTypeApplicationMbmsDeregisterXml = "application/mbms-deregister+xml" // [_3GPP] MediaTypeApplicationMbmsEnvelopeXml = "application/mbms-envelope+xml" // [_3GPP] MediaTypeApplicationMbmsMskResponseXml = "application/mbms-msk-response+xml" // [_3GPP] MediaTypeApplicationMbmsMskXml = "application/mbms-msk+xml" // [_3GPP] MediaTypeApplicationMbmsProtectionDescriptionXml = "application/mbms-protection-description+xml" // [_3GPP] MediaTypeApplicationMbmsReceptionReportXml = "application/mbms-reception-report+xml" // [_3GPP] MediaTypeApplicationMbmsRegisterResponseXml = "application/mbms-register-response+xml" // [_3GPP] MediaTypeApplicationMbmsRegisterXml = "application/mbms-register+xml" // [_3GPP] MediaTypeApplicationMbmsScheduleXml = "application/mbms-schedule+xml" // [_3GPP][Eric_Turcotte] MediaTypeApplicationMbmsUserServiceDescriptionXml = "application/mbms-user-service-description+xml" // [_3GPP] MediaTypeApplicationMbox = "application/mbox" // [RFC4155] MediaTypeApplicationMedia_controlXml = "application/media_control+xml" // [RFC5168] MediaTypeApplicationMediaPolicyDatasetXml = "application/media-policy-dataset+xml" // [RFC6796] MediaTypeApplicationMediaservercontrolXml = "application/mediaservercontrol+xml" // [RFC5022] MediaTypeApplicationMergePatchJson = "application/merge-patch+json" // [RFC7396] MediaTypeApplicationMetalink4Xml = "application/metalink4+xml" // [RFC5854] MediaTypeApplicationMetsXml = "application/mets+xml" // [RFC6207] MediaTypeApplicationMF4 = "application/MF4" // [ASAM][Thomas_Thomsen] MediaTypeApplicationMikey = "application/mikey" // [RFC3830] MediaTypeApplicationMipc = "application/mipc" // [NCGIS][Bryan_Blank] MediaTypeApplicationMissingBlocksCborSeq = "application/missing-blocks+cbor-seq" // [RFC9177] MediaTypeApplicationMmtAeiXml = "application/mmt-aei+xml" // [ATSC] MediaTypeApplicationMmtUsdXml = "application/mmt-usd+xml" // [ATSC] MediaTypeApplicationModsXml = "application/mods+xml" // [RFC6207] MediaTypeApplicationMossKeys = "application/moss-keys" // [RFC1848] MediaTypeApplicationMossSignature = "application/moss-signature" // [RFC1848] MediaTypeApplicationMosskeyData = "application/mosskey-data" // [RFC1848] MediaTypeApplicationMosskeyRequest = "application/mosskey-request" // [RFC1848] MediaTypeApplicationMp21 = "application/mp21" // [RFC6381][David_Singer] MediaTypeApplicationMp4 = "application/mp4" // [RFC4337][RFC6381] MediaTypeApplicationMpeg4Generic = "application/mpeg4-generic" // [RFC3640] MediaTypeApplicationMpeg4Iod = "application/mpeg4-iod" // [RFC4337] MediaTypeApplicationMpeg4IodXmt = "application/mpeg4-iod-xmt" // [RFC4337] MediaTypeApplicationMrbConsumerXml = "application/mrb-consumer+xml" // [RFC6917] MediaTypeApplicationMrbPublishXml = "application/mrb-publish+xml" // [RFC6917] MediaTypeApplicationMscIvrXml = "application/msc-ivr+xml" // [RFC6231] MediaTypeApplicationMscMixerXml = "application/msc-mixer+xml" // [RFC6505] MediaTypeApplicationMsword = "application/msword" // [Paul_Lindner] MediaTypeApplicationMudJson = "application/mud+json" // [RFC8520] MediaTypeApplicationMultipartCore = "application/multipart-core" // [RFC8710] MediaTypeApplicationMxf = "application/mxf" // [RFC4539] MediaTypeApplicationNQuads = "application/n-quads" // [W3C][Eric_Prudhommeaux] MediaTypeApplicationNTriples = "application/n-triples" // [W3C][Eric_Prudhommeaux] MediaTypeApplicationNasdata = "application/nasdata" // [RFC4707] MediaTypeApplicationNewsCheckgroups = "application/news-checkgroups" // [RFC5537] MediaTypeApplicationNewsGroupinfo = "application/news-groupinfo" // [RFC5537] MediaTypeApplicationNewsTransmission = "application/news-transmission" // [RFC5537] MediaTypeApplicationNlsmlXml = "application/nlsml+xml" // [RFC6787] MediaTypeApplicationNode = "application/node" // [Node.js_TSC] MediaTypeApplicationNss = "application/nss" // [Michael_Hammer] MediaTypeApplicationOauthAuthzReqJwt = "application/oauth-authz-req+jwt" // [RFC9101] MediaTypeApplicationObliviousDnsMessage = "application/oblivious-dns-message" // [RFC9230] MediaTypeApplicationOcspRequest = "application/ocsp-request" // [RFC6960] MediaTypeApplicationOcspResponse = "application/ocsp-response" // [RFC6960] MediaTypeApplicationOctetStream = "application/octet-stream" // [RFC2045][RFC2046] MediaTypeApplicationODA = "application/ODA" // [RFC1494] MediaTypeApplicationOdmXml = "application/odm+xml" // [CDISC][Sam_Hume] MediaTypeApplicationODX = "application/ODX" // [ASAM][Thomas_Thomsen] MediaTypeApplicationOebpsPackageXml = "application/oebps-package+xml" // [W3C][EPUB_3_WG] MediaTypeApplicationOgg = "application/ogg" // [RFC5334][RFC7845] MediaTypeApplicationOhttpKeys = "application/ohttp-keys" // [RFC9458] MediaTypeApplicationOpcNodesetXml = "application/opc-nodeset+xml" // [OPC_Foundation] MediaTypeApplicationOscore = "application/oscore" // [RFC8613] MediaTypeApplicationOxps = "application/oxps" // [Ecma_International_Helpdesk] MediaTypeApplicationP21 = "application/p21" // [ISO-TC_184-SC_4][Dana_Tripp] MediaTypeApplicationP21Zip = "application/p21+zip" // [ISO-TC_184-SC_4][Dana_Tripp] MediaTypeApplicationP2pOverlayXml = "application/p2p-overlay+xml" // [RFC6940] MediaTypeApplicationParityfec = "application/parityfec" // [RFC3009] MediaTypeApplicationPassport = "application/passport" // [RFC8225] MediaTypeApplicationPatchOpsErrorXml = "application/patch-ops-error+xml" // [RFC5261] MediaTypeApplicationPdf = "application/pdf" // [RFC8118] MediaTypeApplicationPDX = "application/PDX" // [ASAM][Thomas_Thomsen] MediaTypeApplicationPemCertificateChain = "application/pem-certificate-chain" // [RFC8555] MediaTypeApplicationPgpEncrypted = "application/pgp-encrypted" // [RFC3156] MediaTypeApplicationPgpKeys = "application/pgp-keys" // [RFC3156] MediaTypeApplicationPgpSignature = "application/pgp-signature" // [RFC3156] MediaTypeApplicationPidfDiffXml = "application/pidf-diff+xml" // [RFC5262] MediaTypeApplicationPidfXml = "application/pidf+xml" // [RFC3863] MediaTypeApplicationPkcs10 = "application/pkcs10" // [RFC5967] MediaTypeApplicationPkcs7Mime = "application/pkcs7-mime" // [RFC8551][RFC7114] MediaTypeApplicationPkcs7Signature = "application/pkcs7-signature" // [RFC8551] MediaTypeApplicationPkcs8 = "application/pkcs8" // [RFC5958] MediaTypeApplicationPkcs8Encrypted = "application/pkcs8-encrypted" // [RFC8351] MediaTypeApplicationPkcs12 = "application/pkcs12" // [IETF] MediaTypeApplicationPkixAttrCert = "application/pkix-attr-cert" // [RFC5877] MediaTypeApplicationPkixCert = "application/pkix-cert" // [RFC2585] MediaTypeApplicationPkixCrl = "application/pkix-crl" // [RFC2585] MediaTypeApplicationPkixPkipath = "application/pkix-pkipath" // [RFC6066] MediaTypeApplicationPkixcmp = "application/pkixcmp" // [RFC2510] MediaTypeApplicationPlsXml = "application/pls+xml" // [RFC4267] MediaTypeApplicationPocSettingsXml = "application/poc-settings+xml" // [RFC4354] MediaTypeApplicationPostscript = "application/postscript" // [RFC2045][RFC2046] MediaTypeApplicationPpspTrackerJson = "application/ppsp-tracker+json" // [RFC7846] MediaTypeApplicationPrivateTokenIssuerDirectory = "application/private-token-issuer-directory" // [RFC9578] MediaTypeApplicationPrivateTokenRequest = "application/private-token-request" // [RFC9578] MediaTypeApplicationPrivateTokenResponse = "application/private-token-response" // [RFC9578] MediaTypeApplicationProblemJson = "application/problem+json" // [RFC9457] MediaTypeApplicationProblemXml = "application/problem+xml" // [RFC9457] MediaTypeApplicationProvenanceXml = "application/provenance+xml" // [W3C][Ivan_Herman] MediaTypeApplicationProvidedClaimsJwt = "application/provided-claims+jwt" // [OpenID_Foundation_eKYC_and_IDA_WG][Daniel_Fett] MediaTypeApplicationPrsAlvestrandTitraxSheet = "application/prs.alvestrand.titrax-sheet" // [Harald_T._Alvestrand] MediaTypeApplicationPrsCww = "application/prs.cww" // [Khemchart_Rungchavalnont] MediaTypeApplicationPrsCyn = "application/prs.cyn" // [Cynthia_Revstrテカm] MediaTypeApplicationPrsHpubZip = "application/prs.hpub+zip" // [Giulio_Zambon] MediaTypeApplicationPrsImpliedDocumentXml = "application/prs.implied-document+xml" // [Marek_ト憩rmテ。k] MediaTypeApplicationPrsImpliedExecutable = "application/prs.implied-executable" // [Marek_ト憩rmテ。k] MediaTypeApplicationPrsImpliedObjectJson = "application/prs.implied-object+json" // [Marek_ト憩rmテ。k] MediaTypeApplicationPrsImpliedObjectJsonSeq = "application/prs.implied-object+json-seq" // [Marek_ト憩rmテ。k] MediaTypeApplicationPrsImpliedObjectYaml = "application/prs.implied-object+yaml" // [Marek_ト憩rmテ。k] MediaTypeApplicationPrsImpliedStructure = "application/prs.implied-structure" // [Marek_ト憩rmテ。k] MediaTypeApplicationPrsMayfile = "application/prs.mayfile" // [Azalea_Gardenia] MediaTypeApplicationPrsNprend = "application/prs.nprend" // [Jay_Doggett] MediaTypeApplicationPrsPlucker = "application/prs.plucker" // [Bill_Janssen] MediaTypeApplicationPrsRdfXmlCrypt = "application/prs.rdf-xml-crypt" // [Toby_Inkster] MediaTypeApplicationPrsVcfbzip2 = "application/prs.vcfbzip2" // [Paolo_Marcheschi] MediaTypeApplicationPrsXsfXml = "application/prs.xsf+xml" // [Maik_Stテシhrenberg] MediaTypeApplicationPskcXml = "application/pskc+xml" // [RFC6030] MediaTypeApplicationPvdJson = "application/pvd+json" // [RFC8801] MediaTypeApplicationRdfXml = "application/rdf+xml" // [RFC3870] MediaTypeApplicationRouteApdXml = "application/route-apd+xml" // [ATSC] MediaTypeApplicationRouteSTsidXml = "application/route-s-tsid+xml" // [ATSC] MediaTypeApplicationRouteUsdXml = "application/route-usd+xml" // [ATSC] MediaTypeApplicationQSIG = "application/QSIG" // [RFC3204] MediaTypeApplicationRaptorfec = "application/raptorfec" // [RFC6682] MediaTypeApplicationRdapJson = "application/rdap+json" // [RFC9083] MediaTypeApplicationReginfoXml = "application/reginfo+xml" // [RFC3680] MediaTypeApplicationRelaxNgCompactSyntax = "application/relax-ng-compact-syntax" // [http://www.JTC_1sc34.org/repository/0661.pdf] MediaTypeApplicationReputonJson = "application/reputon+json" // [RFC7071] MediaTypeApplicationResolveResponseJwt = "application/resolve-response+jwt" // [OpenID_Foundation_Artifact_Binding_WG] MediaTypeApplicationResourceListsDiffXml = "application/resource-lists-diff+xml" // [RFC5362] MediaTypeApplicationResourceListsXml = "application/resource-lists+xml" // [RFC4826] MediaTypeApplicationRfcXml = "application/rfc+xml" // [RFC7991] MediaTypeApplicationRiscos = "application/riscos" // [Nick_Smith] MediaTypeApplicationRlmiXml = "application/rlmi+xml" // [RFC4662] MediaTypeApplicationRlsServicesXml = "application/rls-services+xml" // [RFC4826] MediaTypeApplicationRpkiChecklist = "application/rpki-checklist" // [RFC9323] MediaTypeApplicationRpkiGhostbusters = "application/rpki-ghostbusters" // [RFC6493] MediaTypeApplicationRpkiManifest = "application/rpki-manifest" // [RFC6481] MediaTypeApplicationRpkiPublication = "application/rpki-publication" // [RFC8181] MediaTypeApplicationRpkiRoa = "application/rpki-roa" // [RFC9582] MediaTypeApplicationRpkiSignedTal = "application/rpki-signed-tal" // [RFC-ietf-sidrops-signed-tal-16] MediaTypeApplicationRpkiUpdown = "application/rpki-updown" // [RFC6492] MediaTypeApplicationRtf = "application/rtf" // [Paul_Lindner] MediaTypeApplicationRtploopback = "application/rtploopback" // [RFC6849] MediaTypeApplicationRtx = "application/rtx" // [RFC4588] MediaTypeApplicationSamlassertionXml = "application/samlassertion+xml" // [OASIS_Security_Services_Technical_Committee_SSTC] MediaTypeApplicationSamlmetadataXml = "application/samlmetadata+xml" // [OASIS_Security_Services_Technical_Committee_SSTC] MediaTypeApplicationSarifExternalPropertiesJson = "application/sarif-external-properties+json" // [OASIS][David_Keaton][Michael_C._Fanning] MediaTypeApplicationSarifJson = "application/sarif+json" // [OASIS][Michael_C._Fanning][Laurence_J._Golding] MediaTypeApplicationSbe = "application/sbe" // [FIX_Trading_Community][Donald_L._Mendelson] MediaTypeApplicationSbmlXml = "application/sbml+xml" // [RFC3823] MediaTypeApplicationScaipXml = "application/scaip+xml" // [SIS][Oskar_Jonsson] MediaTypeApplicationScimJson = "application/scim+json" // [RFC7644] MediaTypeApplicationScvpCvRequest = "application/scvp-cv-request" // [RFC5055] MediaTypeApplicationScvpCvResponse = "application/scvp-cv-response" // [RFC5055] MediaTypeApplicationScvpVpRequest = "application/scvp-vp-request" // [RFC5055] MediaTypeApplicationScvpVpResponse = "application/scvp-vp-response" // [RFC5055] MediaTypeApplicationSdp = "application/sdp" // [RFC8866] MediaTypeApplicationSeceventJwt = "application/secevent+jwt" // [RFC8417] MediaTypeApplicationSenmlEtchCbor = "application/senml-etch+cbor" // [RFC8790] MediaTypeApplicationSenmlEtchJson = "application/senml-etch+json" // [RFC8790] MediaTypeApplicationSenmlExi = "application/senml-exi" // [RFC8428] MediaTypeApplicationSenmlCbor = "application/senml+cbor" // [RFC8428] MediaTypeApplicationSenmlJson = "application/senml+json" // [RFC8428] MediaTypeApplicationSenmlXml = "application/senml+xml" // [RFC8428] MediaTypeApplicationSensmlExi = "application/sensml-exi" // [RFC8428] MediaTypeApplicationSensmlCbor = "application/sensml+cbor" // [RFC8428] MediaTypeApplicationSensmlJson = "application/sensml+json" // [RFC8428] MediaTypeApplicationSensmlXml = "application/sensml+xml" // [RFC8428] MediaTypeApplicationSepExi = "application/sep-exi" // [Robby_Simpson][IEEE] MediaTypeApplicationSepXml = "application/sep+xml" // [Robby_Simpson][IEEE] MediaTypeApplicationSessionInfo = "application/session-info" // [_3GPP][Frederic_Firmin] MediaTypeApplicationSetPayment = "application/set-payment" // [Brian_Korver] MediaTypeApplicationSetPaymentInitiation = "application/set-payment-initiation" // [Brian_Korver] MediaTypeApplicationSetRegistration = "application/set-registration" // [Brian_Korver] MediaTypeApplicationSetRegistrationInitiation = "application/set-registration-initiation" // [Brian_Korver] MediaTypeApplicationSGML = "application/SGML" // [RFC1874] MediaTypeApplicationSgmlOpenCatalog = "application/sgml-open-catalog" // [Paul_Grosso] MediaTypeApplicationShfXml = "application/shf+xml" // [RFC4194] MediaTypeApplicationSieve = "application/sieve" // [RFC5228] MediaTypeApplicationSimpleFilterXml = "application/simple-filter+xml" // [RFC4661] MediaTypeApplicationSimpleMessageSummary = "application/simple-message-summary" // [RFC3842] MediaTypeApplicationSimpleSymbolContainer = "application/simpleSymbolContainer" // [_3GPP] MediaTypeApplicationSipc = "application/sipc" // [NCGIS][Bryan_Blank] MediaTypeApplicationSlate = "application/slate" // [Terry_Crowley] MediaTypeApplicationSmilXml = "application/smil+xml" // [RFC4536] MediaTypeApplicationSmpte336m = "application/smpte336m" // [RFC6597] MediaTypeApplicationSoapFastinfoset = "application/soap+fastinfoset" // [ITU-T_ASN.1_Rapporteur][ISO-IEC_JTC_1_SC_6_ASN.1_Rapporteur] MediaTypeApplicationSoapXml = "application/soap+xml" // [RFC3902] MediaTypeApplicationSparqlQuery = "application/sparql-query" // [W3C][http://www.w3.org/TR/2007/CR-rdf-sparql-query-20070614/#mediaType] MediaTypeApplicationSpdxJson = "application/spdx+json" // [Linux_Foundation][Rose_Judge] MediaTypeApplicationSparqlResultsXml = "application/sparql-results+xml" // [W3C][http://www.w3.org/TR/2007/CR-rdf-sparql-XMLres-20070925/#mime] MediaTypeApplicationSpiritsEventXml = "application/spirits-event+xml" // [RFC3910] MediaTypeApplicationSql = "application/sql" // [RFC6922] MediaTypeApplicationSrgs = "application/srgs" // [RFC4267] MediaTypeApplicationSrgsXml = "application/srgs+xml" // [RFC4267] MediaTypeApplicationSruXml = "application/sru+xml" // [RFC6207] MediaTypeApplicationSslkeylogfile = "application/sslkeylogfile" // [RFC-ietf-tls-keylogfile-02] MediaTypeApplicationSsmlXml = "application/ssml+xml" // [RFC4267] MediaTypeApplicationST2110_41 = "application/ST2110-41" // [SMPTE][SMPTE_Director_of_Standards_Development] MediaTypeApplicationStixJson = "application/stix+json" // [OASIS][Chet_Ensign] MediaTypeApplicationStratum = "application/stratum" // [Ben_van_Hartingsveldt][1] MediaTypeApplicationSwidCbor = "application/swid+cbor" // [RFC9393] MediaTypeApplicationSwidXml = "application/swid+xml" // [ISO-IEC_JTC_1][David_Waltermire][Ron_Brill] MediaTypeApplicationTampApexUpdate = "application/tamp-apex-update" // [RFC5934] MediaTypeApplicationTampApexUpdateConfirm = "application/tamp-apex-update-confirm" // [RFC5934] MediaTypeApplicationTampCommunityUpdate = "application/tamp-community-update" // [RFC5934] MediaTypeApplicationTampCommunityUpdateConfirm = "application/tamp-community-update-confirm" // [RFC5934] MediaTypeApplicationTampError = "application/tamp-error" // [RFC5934] MediaTypeApplicationTampSequenceAdjust = "application/tamp-sequence-adjust" // [RFC5934] MediaTypeApplicationTampSequenceAdjustConfirm = "application/tamp-sequence-adjust-confirm" // [RFC5934] MediaTypeApplicationTampStatusQuery = "application/tamp-status-query" // [RFC5934] MediaTypeApplicationTampStatusResponse = "application/tamp-status-response" // [RFC5934] MediaTypeApplicationTampUpdate = "application/tamp-update" // [RFC5934] MediaTypeApplicationTampUpdateConfirm = "application/tamp-update-confirm" // [RFC5934] MediaTypeApplicationTaxiiJson = "application/taxii+json" // [OASIS][Chet_Ensign] MediaTypeApplicationTdJson = "application/td+json" // [W3C][Matthias_Kovatsch] MediaTypeApplicationTeiXml = "application/tei+xml" // [RFC6129] MediaTypeApplicationTETRA_ISI = "application/TETRA_ISI" // [ETSI][Miguel_Angel_Reina_Ortega] MediaTypeApplicationThraudXml = "application/thraud+xml" // [RFC5941] MediaTypeApplicationTimestampQuery = "application/timestamp-query" // [RFC3161] MediaTypeApplicationTimestampReply = "application/timestamp-reply" // [RFC3161] MediaTypeApplicationTimestampedData = "application/timestamped-data" // [RFC5955] MediaTypeApplicationTlsrptGzip = "application/tlsrpt+gzip" // [RFC8460] MediaTypeApplicationTlsrptJson = "application/tlsrpt+json" // [RFC8460] MediaTypeApplicationTmJson = "application/tm+json" // [W3C][Sebastian_Kaebisch] MediaTypeApplicationTnauthlist = "application/tnauthlist" // [RFC8226] MediaTypeApplicationTokenIntrospectionJwt = "application/token-introspection+jwt" // [RFC-oauth-jwt-introspection-response-12] MediaTypeApplicationToml = "application/toml" // [Ben_van_Hartingsveldt][https://github.com/toml-lang/toml/issues/870] MediaTypeApplicationTrickleIceSdpfrag = "application/trickle-ice-sdpfrag" // [RFC8840] MediaTypeApplicationTrig = "application/trig" // [W3C][W3C_RDF_Working_Group] MediaTypeApplicationTrustChainJson = "application/trust-chain+json" // [OpenID_Foundation_Artifact_Binding_WG] MediaTypeApplicationTtrustMarkJwt = "application/trust-mark+jwt" // [OpenID_Foundation_Artifact_Binding_WG] MediaTypeApplicationTrustMarkDelegationJwt = "application/trust-mark-delegation+jwt" // [OpenID_Foundation_Artifact_Binding_WG] MediaTypeApplicationTtmlXml = "application/ttml+xml" // [W3C][W3C_Timed_Text_Working_Group] MediaTypeApplicationTveTrigger = "application/tve-trigger" // [Linda_Welsh] MediaTypeApplicationTzif = "application/tzif" // [RFC9636] MediaTypeApplicationTzifLeap = "application/tzif-leap" // [RFC9636] MediaTypeApplicationUccsCbor = "application/uccs+cbor" // [RFC-ietf-rats-uccs-12] MediaTypeApplicationUjcsJson = "application/ujcs+json" // [RFC-ietf-rats-uccs-12] MediaTypeApplicationUlpfec = "application/ulpfec" // [RFC5109] MediaTypeApplicationUrcGrpsheetXml = "application/urc-grpsheet+xml" // [Gottfried_Zimmermann][ISO-IEC_JTC_1] MediaTypeApplicationUrcRessheetXml = "application/urc-ressheet+xml" // [Gottfried_Zimmermann][ISO-IEC_JTC_1] MediaTypeApplicationUrcTargetdescXml = "application/urc-targetdesc+xml" // [Gottfried_Zimmermann][ISO-IEC_JTC_1] MediaTypeApplicationUrcUisocketdescXml = "application/urc-uisocketdesc+xml" // [Gottfried_Zimmermann] MediaTypeApplicationVc = "application/vc" // [W3C][Ivan_Herman] MediaTypeApplicationVcardJson = "application/vcard+json" // [RFC7095] MediaTypeApplicationVcardXml = "application/vcard+xml" // [RFC6351] MediaTypeApplicationVemmi = "application/vemmi" // [RFC2122] MediaTypeApplicationVoicexmlXml = "application/voicexml+xml" // [RFC4267] MediaTypeApplicationVoucherCmsJson = "application/voucher-cms+json" // [RFC8366] MediaTypeApplicationVp = "application/vp" // [W3C][Ivan_Herman] MediaTypeApplicationVqRtcpxr = "application/vq-rtcpxr" // [RFC6035] MediaTypeApplicationWasm = "application/wasm" // [W3C][Eric_Prudhommeaux] MediaTypeApplicationWatcherinfoXml = "application/watcherinfo+xml" // [RFC3858] MediaTypeApplicationWebpushOptionsJson = "application/webpush-options+json" // [RFC8292] MediaTypeApplicationWhoisppQuery = "application/whoispp-query" // [RFC2957] MediaTypeApplicationWhoisppResponse = "application/whoispp-response" // [RFC2958] MediaTypeApplicationWidget = "application/widget" // [W3C][Steven_Pemberton][W3C-Widgets-2012] MediaTypeApplicationWita = "application/wita" // [Larry_Campbell] MediaTypeApplicationWordperfect51 = "application/wordperfect5.1" // [Paul_Lindner] MediaTypeApplicationWsdlXml = "application/wsdl+xml" // [W3C] MediaTypeApplicationWspolicyXml = "application/wspolicy+xml" // [W3C] MediaTypeApplicationXPkiMessage = "application/x-pki-message" // [RFC8894] MediaTypeApplicationXWwwFormUrlencoded = "application/x-www-form-urlencoded" // [WHATWG][Anne_van_Kesteren] MediaTypeApplicationXX509CaCert = "application/x-x509-ca-cert" // [RFC8894] MediaTypeApplicationXX509CaRaCert = "application/x-x509-ca-ra-cert" // [RFC8894] MediaTypeApplicationXX509NextCaCert = "application/x-x509-next-ca-cert" // [RFC8894] MediaTypeApplicationX400Bp = "application/x400-bp" // [RFC1494] MediaTypeApplicationXacmlXml = "application/xacml+xml" // [RFC7061] MediaTypeApplicationXcapAttXml = "application/xcap-att+xml" // [RFC4825] MediaTypeApplicationXcapCapsXml = "application/xcap-caps+xml" // [RFC4825] MediaTypeApplicationXcapDiffXml = "application/xcap-diff+xml" // [RFC5874] MediaTypeApplicationXcapElXml = "application/xcap-el+xml" // [RFC4825] MediaTypeApplicationXcapErrorXml = "application/xcap-error+xml" // [RFC4825] MediaTypeApplicationXcapNsXml = "application/xcap-ns+xml" // [RFC4825] MediaTypeApplicationXconConferenceInfoDiffXml = "application/xcon-conference-info-diff+xml" // [RFC6502] MediaTypeApplicationXconConferenceInfoXml = "application/xcon-conference-info+xml" // [RFC6502] MediaTypeApplicationXencXml = "application/xenc+xml" // [Joseph_Reagle][XENC_Working_Group] MediaTypeApplicationXfdf = "application/xfdf" // [ISO-TC_171-SC_2][Betsy_Fanning] MediaTypeApplicationXhtmlXml = "application/xhtml+xml" // [W3C][Robin_Berjon] MediaTypeApplicationXliffXml = "application/xliff+xml" // [OASIS][Chet_Ensign] MediaTypeApplicationXml = "application/xml" // [RFC7303] MediaTypeApplicationXmlDtd = "application/xml-dtd" // [RFC7303] MediaTypeApplicationXmlExternalParsedEntity = "application/xml-external-parsed-entity" // [RFC7303] MediaTypeApplicationXmlPatchXml = "application/xml-patch+xml" // [RFC7351] MediaTypeApplicationXmppXml = "application/xmpp+xml" // [RFC3923] MediaTypeApplicationXopXml = "application/xop+xml" // [Mark_Nottingham] MediaTypeApplicationXsltXml = "application/xslt+xml" // [W3C][http://www.w3.org/TR/2007/REC-xslt20-20070123/#media-type-registration] MediaTypeApplicationXvXml = "application/xv+xml" // [RFC4374] MediaTypeApplicationYaml = "application/yaml" // [YAML][RFC9512] MediaTypeApplicationYang = "application/yang" // [RFC6020] MediaTypeApplicationYangDataCbor = "application/yang-data+cbor" // [RFC9254] MediaTypeApplicationYangDataJson = "application/yang-data+json" // [RFC8040] MediaTypeApplicationYangDataXml = "application/yang-data+xml" // [RFC8040] MediaTypeApplicationYangPatchJson = "application/yang-patch+json" // [RFC8072] MediaTypeApplicationYangPatchXml = "application/yang-patch+xml" // [RFC8072] MediaTypeApplicationYangSidJson = "application/yang-sid+json" // [RFC9595] MediaTypeApplicationYinXml = "application/yin+xml" // [RFC6020] MediaTypeApplicationZip = "application/zip" // [Paul_Lindner] MediaTypeApplicationZlib = "application/zlib" // [RFC6713] MediaTypeApplicationZstd = "application/zstd" // [RFC8878] MediaTypeAudio1dInterleavedParityfec = "audio/1d-interleaved-parityfec" // [RFC6015] MediaTypeAudio32kadpcm = "audio/32kadpcm" // [RFC3802][RFC2421] MediaTypeAudio3gpp = "audio/3gpp" // [RFC3839][RFC6381] MediaTypeAudio3gpp2 = "audio/3gpp2" // [RFC4393][RFC6381] MediaTypeAudioAac = "audio/aac" // [ISO-IEC_JTC_1][Max_Neuendorf] MediaTypeAudioAc3 = "audio/ac3" // [RFC4184] MediaTypeAudioAMR = "audio/AMR" // [RFC4867] MediaTypeAudioAMR_WB = "audio/AMR-WB" // [RFC4867] MediaTypeAudioAmrWb = "audio/amr-wb+" // [RFC4352] MediaTypeAudioAptx = "audio/aptx" // [RFC7310] MediaTypeAudioAsc = "audio/asc" // [RFC6295] MediaTypeAudioATRAC_ADVANCED_LOSSLESS = "audio/ATRAC-ADVANCED-LOSSLESS" // [RFC5584] MediaTypeAudioATRAC_X = "audio/ATRAC-X" // [RFC5584] MediaTypeAudioATRAC3 = "audio/ATRAC3" // [RFC5584] MediaTypeAudioBasic = "audio/basic" // [RFC2045][RFC2046] MediaTypeAudioBV16 = "audio/BV16" // [RFC4298] MediaTypeAudioBV32 = "audio/BV32" // [RFC4298] MediaTypeAudioClearmode = "audio/clearmode" // [RFC4040] MediaTypeAudioCN = "audio/CN" // [RFC3389] MediaTypeAudioDAT12 = "audio/DAT12" // [RFC3190] MediaTypeAudioDls = "audio/dls" // [RFC4613] MediaTypeAudioDsrEs201108 = "audio/dsr-es201108" // [RFC3557] MediaTypeAudioDsrEs202050 = "audio/dsr-es202050" // [RFC4060] MediaTypeAudioDsrEs202211 = "audio/dsr-es202211" // [RFC4060] MediaTypeAudioDsrEs202212 = "audio/dsr-es202212" // [RFC4060] MediaTypeAudioDV = "audio/DV" // [RFC6469] MediaTypeAudioDVI4 = "audio/DVI4" // [RFC4856] MediaTypeAudioEac3 = "audio/eac3" // [RFC4598] MediaTypeAudioEncaprtp = "audio/encaprtp" // [RFC6849] MediaTypeAudioEVRC = "audio/EVRC" // [RFC4788] MediaTypeAudioEVRC_QCP = "audio/EVRC-QCP" // [RFC3625] MediaTypeAudioEVRC0 = "audio/EVRC0" // [RFC4788] MediaTypeAudioEVRC1 = "audio/EVRC1" // [RFC4788] MediaTypeAudioEVRCB = "audio/EVRCB" // [RFC5188] MediaTypeAudioEVRCB0 = "audio/EVRCB0" // [RFC5188] MediaTypeAudioEVRCB1 = "audio/EVRCB1" // [RFC4788] MediaTypeAudioEVRCNW = "audio/EVRCNW" // [RFC6884] MediaTypeAudioEVRCNW0 = "audio/EVRCNW0" // [RFC6884] MediaTypeAudioEVRCNW1 = "audio/EVRCNW1" // [RFC6884] MediaTypeAudioEVRCWB = "audio/EVRCWB" // [RFC5188] MediaTypeAudioEVRCWB0 = "audio/EVRCWB0" // [RFC5188] MediaTypeAudioEVRCWB1 = "audio/EVRCWB1" // [RFC5188] MediaTypeAudioEVS = "audio/EVS" // [_3GPP][Kyunghun_Jung] MediaTypeAudioExample = "audio/example" // [RFC4735] MediaTypeAudioFlac = "audio/flac" // [RFC-ietf-cellar-flac-14] MediaTypeAudioFlexfec = "audio/flexfec" // [RFC8627] MediaTypeAudioFwdred = "audio/fwdred" // [RFC6354] MediaTypeAudioG711_0 = "audio/G711-0" // [RFC7655] MediaTypeAudioG719 = "audio/G719" // [RFC5404][RFC Errata 3245] MediaTypeAudioG7221 = "audio/G7221" // [RFC5577] MediaTypeAudioG722 = "audio/G722" // [RFC4856] MediaTypeAudioG723 = "audio/G723" // [RFC4856] MediaTypeAudioG726_16 = "audio/G726-16" // [RFC4856] MediaTypeAudioG726_24 = "audio/G726-24" // [RFC4856] MediaTypeAudioG726_32 = "audio/G726-32" // [RFC4856] MediaTypeAudioG726_40 = "audio/G726-40" // [RFC4856] MediaTypeAudioG728 = "audio/G728" // [RFC4856] MediaTypeAudioG729 = "audio/G729" // [RFC4856] MediaTypeAudioG7291 = "audio/G7291" // [RFC4749][RFC5459] MediaTypeAudioG729D = "audio/G729D" // [RFC4856] MediaTypeAudioG729E = "audio/G729E" // [RFC4856] MediaTypeAudioGSM = "audio/GSM" // [RFC4856] MediaTypeAudioGSM_EFR = "audio/GSM-EFR" // [RFC4856] MediaTypeAudioGSM_HR_08 = "audio/GSM-HR-08" // [RFC5993] MediaTypeAudioILBC = "audio/iLBC" // [RFC3952] MediaTypeAudioIp_mr_v25 = "audio/ip-mr_v2.5" // [RFC6262] MediaTypeAudioL8 = "audio/L8" // [RFC4856] MediaTypeAudioL16 = "audio/L16" // [RFC4856] MediaTypeAudioL20 = "audio/L20" // [RFC3190] MediaTypeAudioL24 = "audio/L24" // [RFC3190] MediaTypeAudioLPC = "audio/LPC" // [RFC4856] MediaTypeAudioMatroska = "audio/matroska" // [RFC9559] MediaTypeAudioMELP = "audio/MELP" // [RFC8130] MediaTypeAudioMELP600 = "audio/MELP600" // [RFC8130] MediaTypeAudioMELP1200 = "audio/MELP1200" // [RFC8130] MediaTypeAudioMELP2400 = "audio/MELP2400" // [RFC8130] MediaTypeAudioMhas = "audio/mhas" // [ISO-IEC_JTC_1][Nils_Peters][Ingo_Hofmann] MediaTypeAudioMidiClip = "audio/midi-clip" // [MIDI_Association][Benjamin_Israel] MediaTypeAudioMobileXmf = "audio/mobile-xmf" // [RFC4723] MediaTypeAudioMPA = "audio/MPA" // [RFC3555] MediaTypeAudioMp4 = "audio/mp4" // [RFC4337][RFC6381] MediaTypeAudioMP4A_LATM = "audio/MP4A-LATM" // [RFC6416] MediaTypeAudioMpaRobust = "audio/mpa-robust" // [RFC5219] MediaTypeAudioMpeg = "audio/mpeg" // [RFC3003] MediaTypeAudioMpeg4Generic = "audio/mpeg4-generic" // [RFC3640][RFC5691][RFC6295] MediaTypeAudioOgg = "audio/ogg" // [RFC5334][RFC7845] MediaTypeAudioOpus = "audio/opus" // [RFC7587] MediaTypeAudioParityfec = "audio/parityfec" // [RFC3009] MediaTypeAudioPCMA = "audio/PCMA" // [RFC4856] MediaTypeAudioPCMA_WB = "audio/PCMA-WB" // [RFC5391] MediaTypeAudioPCMU = "audio/PCMU" // [RFC4856] MediaTypeAudioPCMU_WB = "audio/PCMU-WB" // [RFC5391] MediaTypeAudioPrsSid = "audio/prs.sid" // [Linus_Walleij] MediaTypeAudioQCELP = "audio/QCELP" // [RFC3555][RFC3625] MediaTypeAudioRaptorfec = "audio/raptorfec" // [RFC6682] MediaTypeAudioRED = "audio/RED" // [RFC3555] MediaTypeAudioRtpEncAescm128 = "audio/rtp-enc-aescm128" // [_3GPP] MediaTypeAudioRtploopback = "audio/rtploopback" // [RFC6849] MediaTypeAudioRtpMidi = "audio/rtp-midi" // [RFC6295] MediaTypeAudioRtx = "audio/rtx" // [RFC4588] MediaTypeAudioScip = "audio/scip" // [RFC9607] MediaTypeAudioSMV = "audio/SMV" // [RFC3558] MediaTypeAudioSMV0 = "audio/SMV0" // [RFC3558] MediaTypeAudioSMV_QCP = "audio/SMV-QCP" // [RFC3625] MediaTypeAudioSofa = "audio/sofa" // [AES][Piotr_Majdak] MediaTypeAudioSpMidi = "audio/sp-midi" // [Athan_Billias][MIDI_Association] MediaTypeAudioSpeex = "audio/speex" // [RFC5574] MediaTypeAudioT140c = "audio/t140c" // [RFC4351] MediaTypeAudioT38 = "audio/t38" // [RFC4612] MediaTypeAudioTelephoneEvent = "audio/telephone-event" // [RFC4733] MediaTypeAudioTETRA_ACELP = "audio/TETRA_ACELP" // [ETSI][Miguel_Angel_Reina_Ortega] MediaTypeAudioTETRA_ACELP_BB = "audio/TETRA_ACELP_BB" // [ETSI][Miguel_Angel_Reina_Ortega] MediaTypeAudioTone = "audio/tone" // [RFC4733] MediaTypeAudioTSVCIS = "audio/TSVCIS" // [RFC8817] MediaTypeAudioUEMCLIP = "audio/UEMCLIP" // [RFC5686] MediaTypeAudioUlpfec = "audio/ulpfec" // [RFC5109] MediaTypeAudioUsac = "audio/usac" // [ISO-IEC_JTC_1][Max_Neuendorf] MediaTypeAudioVDVI = "audio/VDVI" // [RFC4856] MediaTypeAudioVMR_WB = "audio/VMR-WB" // [RFC4348][RFC4424] MediaTypeAudioVorbis = "audio/vorbis" // [RFC5215] MediaTypeAudioVorbisConfig = "audio/vorbis-config" // [RFC5215] MediaTypeFontCollection = "font/collection" // [RFC8081] MediaTypeFontOtf = "font/otf" // [RFC8081] MediaTypeFontSfnt = "font/sfnt" // [RFC8081] MediaTypeFontTtf = "font/ttf" // [RFC8081] MediaTypeFontWoff = "font/woff" // [RFC8081] MediaTypeFontWoff2 = "font/woff2" // [RFC8081] MediaTypeHapticsIvs = "haptics/ivs" // [RFC-ietf-mediaman-haptics-05] MediaTypeHapticsHjif = "haptics/hjif" // [RFC-ietf-mediaman-haptics-05] MediaTypeHapticsHmpg = "haptics/hmpg" // [RFC-ietf-mediaman-haptics-05] MediaTypeImageAces = "image/aces" // [SMPTE][Howard_Lukk] MediaTypeImageApng = "image/apng" // [W3C][W3C_PNG_Working_Group] MediaTypeImageAvci = "image/avci" // [ISO-IEC_JTC_1][David_Singer] MediaTypeImageAvcs = "image/avcs" // [ISO-IEC_JTC_1][David_Singer] MediaTypeImageAvif = "image/avif" // [Alliance_for_Open_Media][Cyril_Concolato] MediaTypeImageBmp = "image/bmp" // [RFC7903] MediaTypeImageCgm = "image/cgm" // [Alan_Francis] MediaTypeImageDicomRle = "image/dicom-rle" // [DICOM_Standard_Committee][David_Clunie] MediaTypeImageDpx = "image/dpx" // [SMPTE][SMPTE_Director_of_Standards_Development] MediaTypeImageEmf = "image/emf" // [RFC7903] MediaTypeImageExample = "image/example" // [RFC4735] MediaTypeImageFits = "image/fits" // [RFC4047] MediaTypeImageG3fax = "image/g3fax" // [RFC1494] MediaTypeImageGif = "image/gif" // [RFC2045][RFC2046] MediaTypeImageHeic = "image/heic" // [ISO-IEC_JTC_1][David_Singer] MediaTypeImageHeicSequence = "image/heic-sequence" // [ISO-IEC_JTC_1][David_Singer] MediaTypeImageHeif = "image/heif" // [ISO-IEC_JTC_1][David_Singer] MediaTypeImageHeifSequence = "image/heif-sequence" // [ISO-IEC_JTC_1][David_Singer] MediaTypeImageHej2k = "image/hej2k" // [ISO-IEC_JTC_1][ITU-T] MediaTypeImageIef = "image/ief" // [RFC1314] MediaTypeImageJ2c = "image/j2c" // [ISO-IEC_JTC_1_SC_29_WG_1][ISO-IEC_JTC_1][ITU-T] MediaTypeImageJls = "image/jls" // [DICOM_Standard_Committee][David_Clunie] MediaTypeImageJp2 = "image/jp2" // [RFC3745] MediaTypeImageJpeg = "image/jpeg" // [RFC2045][RFC2046] MediaTypeImageJph = "image/jph" // [ISO-IEC_JTC_1][ITU-T] MediaTypeImageJphc = "image/jphc" // [ISO-IEC_JTC_1][ITU-T] MediaTypeImageJpm = "image/jpm" // [RFC3745] MediaTypeImageJpx = "image/jpx" // [RFC3745][ISO-IEC_JTC_1_SC_29_WG_1] MediaTypeImageJxl = "image/jxl" // [ISO-IEC_JTC_1_SC_29_WG_1][ISO-IEC_JTC_1] MediaTypeImageJxr = "image/jxr" // [ISO-IEC_JTC_1][ITU-T] MediaTypeImageJxrA = "image/jxrA" // [ISO-IEC_JTC_1][ITU-T] MediaTypeImageJxrS = "image/jxrS" // [ISO-IEC_JTC_1][ITU-T] MediaTypeImageJxs = "image/jxs" // [ISO-IEC_JTC_1] MediaTypeImageJxsc = "image/jxsc" // [ISO-IEC_JTC_1] MediaTypeImageJxsi = "image/jxsi" // [ISO-IEC_JTC_1] MediaTypeImageJxss = "image/jxss" // [ISO-IEC_JTC_1] MediaTypeImageKtx = "image/ktx" // [Khronos][Mark_Callow] MediaTypeImageKtx2 = "image/ktx2" // [Khronos][Mark_Callow] MediaTypeImageNaplps = "image/naplps" // [Ilya_Ferber] MediaTypeImagePng = "image/png" // [W3C][PNG_Working_Group] MediaTypeImagePrsBtif = "image/prs.btif" // [Ben_Simon] MediaTypeImagePrsPti = "image/prs.pti" // [Juern_Laun] MediaTypeImagePwgRaster = "image/pwg-raster" // [Michael_Sweet] MediaTypeImageSvgXml = "image/svg+xml" // [W3C][http://www.w3.org/TR/SVG/mimereg.html] MediaTypeImageT38 = "image/t38" // [RFC3362] MediaTypeImageTiff = "image/tiff" // [RFC3302] MediaTypeImageTiffFx = "image/tiff-fx" // [RFC3950] MediaTypeImageWebp = "image/webp" // [RFC9649] MediaTypeImageWmf = "image/wmf" // [RFC7903] MediaTypeMessageBhttp = "message/bhttp" // [RFC9292] MediaTypeMessageCPIM = "message/CPIM" // [RFC3862] MediaTypeMessageDeliveryStatus = "message/delivery-status" // [RFC1894] MediaTypeMessageDispositionNotification = "message/disposition-notification" // [RFC8098] MediaTypeMessageExample = "message/example" // [RFC4735] MediaTypeMessageExternalBody = "message/external-body" // [RFC2045][RFC2046] MediaTypeMessageFeedbackReport = "message/feedback-report" // [RFC5965] MediaTypeMessageGlobal = "message/global" // [RFC6532] MediaTypeMessageGlobalDeliveryStatus = "message/global-delivery-status" // [RFC6533] MediaTypeMessageGlobalDispositionNotification = "message/global-disposition-notification" // [RFC6533] MediaTypeMessageGlobalzHeaders = "message/global-headers" // [RFC6533] MediaTypeMessageHttp = "message/http" // [RFC9112] MediaTypeMessageImdnXml = "message/imdn+xml" // [RFC5438] MediaTypeMessageMls = "message/mls" // [RFC9420] MediaTypeMessageOhttpReq = "message/ohttp-req" // [RFC9458] MediaTypeMessageOhttpRes = "message/ohttp-res" // [RFC9458] MediaTypeMessagePartial = "message/partial" // [RFC2045][RFC2046] MediaTypeMessageRfc822 = "message/rfc822" // [RFC2045][RFC2046] MediaTypeMessageSip = "message/sip" // [RFC3261] MediaTypeMessageSipfrag = "message/sipfrag" // [RFC3420] MediaTypeMessageTrackingStatus = "message/tracking-status" // [RFC3886] MediaTypeModel3mf = "model/3mf" // [http://www.3mf.io/specification][_3MF][Michael_Sweet] MediaTypeModelE57 = "model/e57" // [ASTM] MediaTypeModelExample = "model/example" // [RFC4735] MediaTypeModelGltfBinary = "model/gltf-binary" // [Khronos][Saurabh_Bhatia] MediaTypeModelGltfJson = "model/gltf+json" // [Khronos][Uli_Klumpp] MediaTypeModelJT = "model/JT" // [ISO-TC_184-SC_4][Michael_Zink] MediaTypeModelIges = "model/iges" // [Curtis_Parks] MediaTypeModelMesh = "model/mesh" // [RFC2077] MediaTypeModelMtl = "model/mtl" // [DICOM_Standard_Committee][DICOM_WG_17][Carolyn_Hull] MediaTypeModelObj = "model/obj" // [DICOM_Standard_Committee][DICOM_WG_17][Carolyn_Hull] MediaTypeModelPrc = "model/prc" // [ISO-TC_171-SC_2][Betsy_Fanning] MediaTypeModelStep = "model/step" // [ISO-TC_184-SC_4][Dana_Tripp] MediaTypeModelStepXml = "model/step+xml" // [ISO-TC_184-SC_4][Dana_Tripp] MediaTypeModelStepZip = "model/step+zip" // [ISO-TC_184-SC_4][Dana_Tripp] MediaTypeModelStepXmlZip = "model/step-xml+zip" // [ISO-TC_184-SC_4][Dana_Tripp] MediaTypeModelStl = "model/stl" // [DICOM_Standard_Committee][DICOM_WG_17][Carolyn_Hull] MediaTypeModelU3d = "model/u3d" // [PDF_Association][Peter_Wyatt] MediaTypeModelVrml = "model/vrml" // [RFC2077] MediaTypeModelX3dVrml = "model/x3d-vrml" // [Web3D][Web3D_X3D] MediaTypeModelX3dFastinfoset = "model/x3d+fastinfoset" // [Web3D_X3D] MediaTypeModelX3dXml = "model/x3d+xml" // [Web3D][Web3D_X3D] MediaTypeText1dInterleavedParityfec = "text/1d-interleaved-parityfec" // [RFC6015] MediaTypeTextCacheManifest = "text/cache-manifest" // [W3C][Robin_Berjon] MediaTypeTextCalendar = "text/calendar" // [RFC5545] MediaTypeTextCql = "text/cql" // [HL7][Bryn_Rhodes] MediaTypeTextCqlExpression = "text/cql-expression" // [HL7][Bryn_Rhodes] MediaTypeTextCqlIdentifier = "text/cql-identifier" // [HL7][Bryn_Rhodes] MediaTypeTextCss = "text/css" // [RFC2318] MediaTypeTextCsv = "text/csv" // [RFC4180][RFC7111] MediaTypeTextCsvSchema = "text/csv-schema" // [National_Archives_UK][David_Underdown] MediaTypeTextDns = "text/dns" // [RFC4027] MediaTypeTextEncaprtp = "text/encaprtp" // [RFC6849] MediaTypeTextEnriched = "text/enriched" // [RFC1896] MediaTypeTextExample = "text/example" // [RFC4735] MediaTypeTextFhirpath = "text/fhirpath" // [HL7][Bryn_Rhodes] MediaTypeTextFlexfec = "text/flexfec" // [RFC8627] MediaTypeTextFwdred = "text/fwdred" // [RFC6354] MediaTypeTextGff3 = "text/gff3" // [Sequence_Ontology] MediaTypeTextGrammarRefList = "text/grammar-ref-list" // [RFC6787] MediaTypeTextHl7v2 = "text/hl7v2" // [HL7][Marc_Duteau] MediaTypeTextHtml = "text/html" // [W3C][Robin_Berjon] MediaTypeTextJavascript = "text/javascript" // [RFC9239] MediaTypeTextJcrCnd = "text/jcr-cnd" // [Peeter_Piegaze] MediaTypeTextMarkdown = "text/markdown" // [RFC7763] MediaTypeTextMizar = "text/mizar" // [Jesse_Alama] MediaTypeTextN3 = "text/n3" // [W3C][Eric_Prudhommeaux] MediaTypeTextParameters = "text/parameters" // [RFC7826] MediaTypeTextParityfec = "text/parityfec" // [RFC3009] MediaTypeTextPlain = "text/plain" // [RFC2046][RFC3676][RFC5147] MediaTypeTextProvenanceNotation = "text/provenance-notation" // [W3C][Ivan_Herman] MediaTypeTextPrsFallensteinRst = "text/prs.fallenstein.rst" // [Benja_Fallenstein] MediaTypeTextPrsLinesTag = "text/prs.lines.tag" // [John_Lines] MediaTypeTextPrsPropLogic = "text/prs.prop.logic" // [Hans-Dieter_A._Hiep] MediaTypeTextPrsTexi = "text/prs.texi" // [Matin_Bavardi] MediaTypeTextRaptorfec = "text/raptorfec" // [RFC6682] MediaTypeTextRED = "text/RED" // [RFC4102] MediaTypeTextRfc822Headers = "text/rfc822-headers" // [RFC6522] MediaTypeTextRichtext = "text/richtext" // [RFC2045][RFC2046] MediaTypeTextRtf = "text/rtf" // [Paul_Lindner] MediaTypeTextRtpEncAescm128 = "text/rtp-enc-aescm128" // [_3GPP] MediaTypeTextRtploopback = "text/rtploopback" // [RFC6849] MediaTypeTextRtx = "text/rtx" // [RFC4588] MediaTypeTextSGML = "text/SGML" // [RFC1874] MediaTypeTextShaclc = "text/shaclc" // [W3C_SHACL_Community_Group][Vladimir_Alexiev] MediaTypeTextShex = "text/shex" // [W3C][Eric_Prudhommeaux] MediaTypeTextSpdx = "text/spdx" // [Linux_Foundation][Rose_Judge] MediaTypeTextStrings = "text/strings" // [IEEE-ISTO-PWG-PPP] MediaTypeTextT140 = "text/t140" // [RFC4103] MediaTypeTextTabSeparatedValues = "text/tab-separated-values" // [Paul_Lindner] MediaTypeTextTroff = "text/troff" // [RFC4263] MediaTypeTextTurtle = "text/turtle" // [W3C][Eric_Prudhommeaux] MediaTypeTextUlpfec = "text/ulpfec" // [RFC5109] MediaTypeTextUriList = "text/uri-list" // [RFC2483] MediaTypeTextVcard = "text/vcard" // [RFC6350] MediaTypeTextVtt = "text/vtt" // [W3C][Silvia_Pfeiffer] MediaTypeTextWgsl = "text/wgsl" // [W3C][David_Neto] MediaTypeTextXml = "text/xml" // [RFC7303] MediaTypeTextXmlExternalParsedEntity = "text/xml-external-parsed-entity" // [RFC7303] MediaTypeVideo1dInterleavedParityfec = "video/1d-interleaved-parityfec" // [RFC6015] MediaTypeVideo3gpp = "video/3gpp" // [RFC3839][RFC6381] MediaTypeVideo3gpp2 = "video/3gpp2" // [RFC4393][RFC6381] MediaTypeVideo3gppTt = "video/3gpp-tt" // [RFC4396] MediaTypeVideoAV1 = "video/AV1" // [Alliance_for_Open_Media] MediaTypeVideoBMPEG = "video/BMPEG" // [RFC3555] MediaTypeVideoBT656 = "video/BT656" // [RFC3555] MediaTypeVideoCelB = "video/CelB" // [RFC3555] MediaTypeVideoDV = "video/DV" // [RFC6469] MediaTypeVideoEncaprtp = "video/encaprtp" // [RFC6849] MediaTypeVideoEvc = "video/evc" // [RFC9584] MediaTypeVideoExample = "video/example" // [RFC4735] MediaTypeVideoFFV1 = "video/FFV1" // [RFC9043] MediaTypeVideoFlexfec = "video/flexfec" // [RFC8627] MediaTypeVideoH261 = "video/H261" // [RFC4587] MediaTypeVideoH263 = "video/H263" // [RFC3555] MediaTypeVideoH263_1998 = "video/H263-1998" // [RFC4629] MediaTypeVideoH263_2000 = "video/H263-2000" // [RFC4629] MediaTypeVideoH264 = "video/H264" // [RFC6184] MediaTypeVideoH264RCDO = "video/H264-RCDO" // [RFC6185] MediaTypeVideoH264SVC = "video/H264-SVC" // [RFC6190] MediaTypeVideoH265 = "video/H265" // [RFC7798] MediaTypeVideoH266 = "video/H266" // [RFC9328] MediaTypeVideoIsoSegment = "video/iso.segment" // [David_Singer][ISO-IEC_JTC_1] MediaTypeVideoJPEG = "video/JPEG" // [RFC3555] MediaTypeVideoJpeg2000 = "video/jpeg2000" // [RFC5371][RFC5372] MediaTypeVideoJxsv = "video/jxsv" // [RFC9134] MediaTypeVideoMatroska = "video/matroska" // [RFC9559] MediaTypeVideoMatroska3d = "video/matroska-3d" // [RFC9559] MediaTypeVideoMj2 = "video/mj2" // [RFC3745] MediaTypeVideoMP1S = "video/MP1S" // [RFC3555] MediaTypeVideoMP2P = "video/MP2P" // [RFC3555] MediaTypeVideoMP2T = "video/MP2T" // [RFC3555] MediaTypeVideoMp4 = "video/mp4" // [RFC4337][RFC6381] MediaTypeVideoMP4VES = "video/MP4V-ES" // [RFC6416] MediaTypeVideoMPV = "video/MPV" // [RFC3555] MediaTypeVideoMpeg = "video/mpeg" // [RFC2045][RFC2046] MediaTypeVideoMpeg4Generic = "video/mpeg4-generic" // [RFC3640] MediaTypeVideoNv = "video/nv" // [RFC4856] MediaTypeVideoOgg = "video/ogg" // [RFC5334][RFC7845] MediaTypeVideoParityfec = "video/parityfec" // [RFC3009] MediaTypeVideoPointer = "video/pointer" // [RFC2862] MediaTypeVideoQuicktime = "video/quicktime" // [RFC6381][Paul_Lindner] MediaTypeVideoRaptorfec = "video/raptorfec" // [RFC6682] MediaTypeVideoRaw = "video/raw" // [RFC4175] MediaTypeVideoRtpEncAescm128 = "video/rtp-enc-aescm128" // [_3GPP] MediaTypeVideoRtploopback = "video/rtploopback" // [RFC6849] MediaTypeVideoRtx = "video/rtx" // [RFC4588] MediaTypeVideoScip = "video/scip" // [RFC9607] MediaTypeVideoSmpte291 = "video/smpte291" // [RFC8331] MediaTypeVideoSMPTE292M = "video/SMPTE292M" // [RFC3497] MediaTypeVideoUlpfec = "video/ulpfec" // [RFC5109] MediaTypeVideoVc1 = "video/vc1" // [RFC4425] MediaTypeVideoVc2 = "video/vc2" // [RFC8450] MediaTypeVideoVP8 = "video/VP8" // [RFC7741] MediaTypeVideoVP9 = "video/VP9" // [RFC-ietf-payload-vp9-16] )
const ( CausePreRoundTrip = "znet/zhttp: PreRoundTrip hook returned an error" CausePostRoundTrip = "znet/zhttp: PostRoundTrip hook returned an error" CauseTransport = "znet/zhttp: proxy transport returned an error" CauseUpgrade = "znet/zhttp: handling upgrade response failed" CauseCopyResponse = "znet/zhttp: copying response body to client failed. may be client canceled the request" CauseFlushBody = "znet/zhttp: flushing response body failed" CauseUpgradeMismatch = "znet/zhttp: upgrade protocol mismatch" CauseUpgradeSwitch = "znet/zhttp: 101 switching protocol failed" CauseHijack = "znet/zhttp: hijacking response writer failed while switching protocol" )
Variables ¶
var ( // ErrCannotRewind is the error that means the body of [http.Request] cannot be rewound. // That means the request has a header of "Idempotency-Key" or "X-Idempotency-Key". // Or the [http.Request.GetBody] is nil. ErrCannotRewind = errors.New("zhttp: cannot rewind request body") )
var NewErrorHandler = func(lg zlog.Logger) ErrorHandler { return func(w http.ResponseWriter, r *http.Request, err error) { if herr, ok := err.(*HTTPError); ok { if herr.Code >= 500 { attrs := []any{zslog.ErrorAttr(err), zslog.CallerAttr(1), zslog.FramesAttr(0)} lg.ErrorContext(r.Context(), "server-side error", attrs...) } else if lg.DebugEnabled(r.Context()) { attrs := []any{zslog.ErrorAttr(err), zslog.CallerAttr(1), zslog.FramesAttr(0)} lg.DebugContext(r.Context(), "http error handler received an error", attrs...) } http.Error(w, http.StatusText(herr.Code), herr.Code) return } attrs := []any{zslog.ErrorAttr(err), zslog.CallerAttr(1), zslog.FramesAttr(0)} lg.ErrorContext(r.Context(), "server-side error", attrs...) http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) } }
NewErrorHandler returns a new error handler with the given logger. A default error handler checks if the err is HTTPError or not. If the err is type of HTTPError, it returns an error response with status code specified in the [HTTPError.Code]. Other errors results in an Internal Server Error.
Functions ¶
func CopyHeaders ¶
CopyHeaders copies headers from src to dst. It does not delete existing values but append to it.
func CopyTrailers ¶
CopyTrailers copies trailers from src to dst. Header keys in src are copied with the prefix defined as http.TrailerPrefix. It does not delete existing trailers in dst but append to it.
func MatchMediaType ¶
MatchMediaType returns the first index of the list that matched to the mt. It returns -1 when no matching media type was found. Given media type should be in the form of "<BaseType>/<SubType>" as defined in RFC 9110. An wildcard character "*" can be used for <BaseType> or/and <SubType>. But it cannot contain any parameters such as "charset". For example "text/plain" matches to the "text/plain", "*/plain", "text/*", "*/*". Given strings are not validated whether they are valid media types or not.
References:
- https://datatracker.ietf.org/doc/html/rfc9110
- https://www.iana.org/assignments/media-types/media-types.xhtml
Example ¶
package main
import (
"fmt"
"github.com/aileron-projects/go/znet/zhttp"
)
func main() {
fmt.Println(zhttp.MatchMediaType("text/plain", []string{"application/json", "application/*"}))
fmt.Println(zhttp.MatchMediaType("text/plain", []string{"application/json", "text/plain"}))
fmt.Println(zhttp.MatchMediaType("text/plain", []string{"application/json", "text/*"}))
fmt.Println(zhttp.MatchMediaType("text/plain", []string{"application/json", "*/*"}))
fmt.Println(zhttp.MatchMediaType("text-plain", []string{"application/json", "*/*"}))
}
Output: -1 1 1 1 -1
func NewHandler ¶
func NewHandler(h http.Handler, ms ...ServerMiddleware) http.Handler
NewHandler returns a http handler with server middleware. NewHandler is short for ServerMiddlewareChain(ms).Handler(h).
func NewRoundTripper ¶
func NewRoundTripper(rt http.RoundTripper, ms ...ClientMiddleware) http.RoundTripper
NewRoundTripper returns a http round tripper with client middleware. NewRoundTripper is short for ClientMiddlewareChain(ms).RoundTripper(rt).
func ParseHeader ¶
ParseHeader parses header value with parameters. It returns parsed values and their accompanying parameters. Parameters are defined as the following format in RFC9110 - 5.6.6. Parameters. Note that even white spaces around the "=" is not allowed in RFC9110 this function accept it and trims white spaces for convenience.
parameters = *( OWS ";" OWS [ parameter ] ) parameter = parameter-name "=" parameter-value parameter-name = token parameter-value = ( token / quoted-string )
References:
Example ¶
package main
import (
"fmt"
"github.com/aileron-projects/go/znet/zhttp"
)
func main() {
fmt.Println(zhttp.ParseHeader("foo"))
fmt.Println(zhttp.ParseHeader("foo; p=x"))
fmt.Println(zhttp.ParseHeader("foo; p=x; q=y"))
fmt.Println(zhttp.ParseHeader("foo; p=x; q=y, bar"))
}
Output: [foo] [map[]] [foo] [map[p:x]] [foo] [map[p:x q:y]] [foo bar] [map[p:x q:y] map[]]
func ParseQualifiedHeader ¶
ParseQualifiedHeader parses header value with qualifier, or q-value. It returns sorted values and parameters with ascending order with q-value. Q-value, as defined in RFC9110, should be a floating value ranges 0.000 <= q <= 1.000. If a q-value has more than 3 digits after decimal point, only first 3 digits are valid and used. For example, q-value "0.1234" will be parsed as "0.123".
The entries with the following q-value are excluded from the returned values as it is invalid.
- The entry with q=0.
- The entry with q<0 or q>1.
- The entry with q that have non-parsable number.
References:
Example ¶
package main
import (
"fmt"
"github.com/aileron-projects/go/znet/zhttp"
)
func main() {
fmt.Println(zhttp.ParseQualifiedHeader("foo"))
fmt.Println(zhttp.ParseQualifiedHeader("foo; q=0.5"))
fmt.Println(zhttp.ParseQualifiedHeader("foo; q=0.123"))
fmt.Println(zhttp.ParseQualifiedHeader("foo; q=0.1234")) // Parsed as 0.123
fmt.Println(zhttp.ParseQualifiedHeader("foo, bar"))
fmt.Println(zhttp.ParseQualifiedHeader("foo; q=0.3, bar; q=0.5"))
fmt.Println(zhttp.ParseQualifiedHeader("foo; q=0.0, bar; q=0.5")) // foo is ignored
fmt.Println(zhttp.ParseQualifiedHeader("foo; q=1.2, bar; q=0.5")) // foo is ignored
}
Output: [foo] [map[]] [foo] [map[q:0.5]] [foo] [map[q:0.123]] [foo] [map[q:0.1234]] [foo bar] [map[] map[]] [bar foo] [map[q:0.5] map[q:0.3]] [bar] [map[q:0.5]] [bar] [map[q:0.5]]
func RemoveHopByHopHeaders ¶
RemoveHopByHopHeaders removes hop-by-hop headers. See the references about removed headers.
References:
- https://go.dev/src/net/http/httputil/reverseproxy.go
- https://datatracker.ietf.org/doc/rfc7230/
- https://datatracker.ietf.org/doc/rfc2616/
Removed headers:
- Connection
- Keep-Alive
- Proxy-Authenticate
- Proxy-Authorization
- Te
- Trailer
- Transfer-Encoding
- Upgrade
- Proxy-Connection
- Headers in "Connection"
func RewindBody ¶
RewindBody rewinds the request body. It modifies the r.Body if the request is rewindable. If the r has a header of "Idempotency-Key" or "X-Idempotency-Key", or the r.GetBody is not available, an ErrCannotRewind will be returned. For making the request retry-able, call the SetupRewindBody before sending the first request.
References:
func ScanElement ¶
ScanElement scans the s which is expected to be in list-based field values defined in RFC9110 and returns the first found element. It splits s by ',' to parse the first element. OWS, or optional white spaces, are trimmed and empty elements are ignored. The returned elem will be an empty string when no valid elements was found in the s.
RFC9110 5.6. Common Rules for Defining Field Values Empty elements do not contribute to the count of elements present. A recipient MUST parse and ignore a reasonable number of empty list elements: enough to handle common mistakes by senders that merge values, but not so much that they could be used as a denial-of-service mechanism. In other words, a recipient MUST accept lists that satisfy the following syntax: #element => [ element ] *( OWS "," OWS [ element ] ) Valid example: "foo,bar" "foo ,bar," "foo , ,bar,charlie"
References:
Example ¶
package main
import (
"fmt"
"github.com/aileron-projects/go/znet/zhttp"
)
func main() {
println := func(s1, s2 string) {
fmt.Printf("`%s` | `%s`\n", s1, s2)
}
println(zhttp.ScanElement("foo"))
println(zhttp.ScanElement("foo; p=x"))
println(zhttp.ScanElement("foo; p=x; q=y"))
println(zhttp.ScanElement("foo; p=x; q=y, bar"))
}
Output: `foo` | `` `foo; p=x` | `` `foo; p=x; q=y` | `` `foo; p=x; q=y` | ` bar`
func SetForwardedHeaders ¶
SetForwardedHeaders sets the Forwarded, X-Forwarded-For, X-Forwarded-Host, and X-Forwarded-Proto headers to the given h. Argument r and h must not be nil. Forwarded header is defined in RFC7239.
References:
- https://go.dev/src/net/http/httputil/reverseproxy.go
- https://datatracker.ietf.org/doc/rfc7239/
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto
func SetupRewindBody ¶
SetupRewindBody makes the r retry-able by filling the r.GetBody field. It modifies the r.Body and r.GetBody if the request is rewindable. If the r has a header of "Idempotency-Key" or "X-Idempotency-Key", an ErrCannotRewind will be returned. Note that the entire body of r is read on memory. SetupRewindBody should be called before sending the first request.
References:
Types ¶
type ClientMiddleware ¶
type ClientMiddleware interface {
ClientMiddleware(next http.RoundTripper) http.RoundTripper
}
ClientMiddleware is the client side middleware.
type ClientMiddlewareChain ¶
type ClientMiddlewareChain []ClientMiddleware
ClientMiddlewareChain is the middleware chain of ClientMiddleware. ClientMiddlewareChain implements the ClientMiddleware interface itself.
func (*ClientMiddlewareChain) Add ¶
func (c *ClientMiddlewareChain) Add(ms ...ClientMiddleware)
Add adds given middleware to the chain. Middleware are added at the end of the chain keeping the order. Note that nil value will cause an panic.
func (*ClientMiddlewareChain) AfterAll ¶
func (c *ClientMiddlewareChain) AfterAll(ms ...ClientMiddleware)
AfterAll inserts the ms after all existing middleware. That is, the given ms is inserted at the index from 1 to n. Note that nil middleware will cause an panic.
× ○ ○ ○ ○ ○ ○
┌──────┬──────┬──────┬──────┬─────┬────────┐
chain │ m[0] │ m[1] │ m[2] │ m[3] │ ... │ m[n-1] │
├──────┼──────┼──────┼──────┼─────┼────────┤
↑ ↑ ↑ ↑ ↑ ↑ ↑
index 0 1 2 3 4 n-1 n
func (*ClientMiddlewareChain) BeforeAll ¶
func (c *ClientMiddlewareChain) BeforeAll(ms ...ClientMiddleware)
BeforeAll inserts the ms before all existing middleware. That is, the given ms is inserted at the index from 0 to n-1. Note that nil middleware will cause an panic.
○ ○ ○ ○ ○ ○ ×
┌──────┬──────┬──────┬──────┬─────┬────────┐
chain │ m[0] │ m[1] │ m[2] │ m[3] │ ... │ m[n-1] │
├──────┼──────┼──────┼──────┼─────┼────────┤
↑ ↑ ↑ ↑ ↑ ↑ ↑
index 0 1 2 3 4 n-1 n
func (ClientMiddlewareChain) ClientMiddleware ¶
func (c ClientMiddlewareChain) ClientMiddleware(next http.RoundTripper) http.RoundTripper
ClientMiddleware is the implementation of [ClientMiddleware.ClientMiddleware].
func (*ClientMiddlewareChain) Insert ¶
func (c *ClientMiddlewareChain) Insert(index int, ms ...ClientMiddleware)
Insert inserts the given middleware at the position of index. If index<=0, ms are added at the beginning of the chain. If index>=len(c), ms are added at the end of the chain. Note that nil middleware will cause an panic.
┌──────┬──────┬──────┬──────┬─────┬────────┐
chain │ m[0] │ m[1] │ m[2] │ m[3] │ ... │ m[n-1] │
├──────┼──────┼──────┼──────┼─────┼────────┤
↑ ↑ ↑ ↑ ↑ ↑ ↑
index 0 1 2 3 4 n-1 n
func (*ClientMiddlewareChain) InsertAll ¶
func (c *ClientMiddlewareChain) InsertAll(ms ...ClientMiddleware)
InsertAll inserts the ms between each middleware. That is, the given ms is inserted at the index from 0 to n. Inserting to an empty chain will be ms itself. Note that nil middleware will cause an panic.
○ ○ ○ ○ ○ ○ ○
┌──────┬──────┬──────┬──────┬─────┬────────┐
chain │ m[0] │ m[1] │ m[2] │ m[3] │ ... │ m[n-1] │
├──────┼──────┼──────┼──────┼─────┼────────┤
↑ ↑ ↑ ↑ ↑ ↑ ↑
index 0 1 2 3 4 n-1 n
func (ClientMiddlewareChain) RoundTripper ¶
func (c ClientMiddlewareChain) RoundTripper(rt http.RoundTripper, ms ...ClientMiddleware) http.RoundTripper
RoundTripper returns a round tripper with middleware. Additional middleware is applied at the end of the chain but they are not registered to this middleware chain.
type ClientMiddlewareFunc ¶
type ClientMiddlewareFunc func(next http.RoundTripper) http.RoundTripper
ClientMiddlewareFunc type is an adapter to allow the use of ordinary function as client middleware. If f is a function with the appropriate signature, ClientMiddlewareFunc(f) is ClientMiddleware that calls f.
Example:
var m ClientMiddleware
m = ClientMiddlewareFunc(func(next http.RoundTripper) http.RoundTripper {
return RoundTripperFunc(func(r *http.Request) (*http.Response, error) {
// Some process.
return next.RoundTrip(r)
})
})
func (ClientMiddlewareFunc) ClientMiddleware ¶
func (f ClientMiddlewareFunc) ClientMiddleware(next http.RoundTripper) http.RoundTripper
type ErrorHandler ¶
type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error)
ErrorHandler handles HTTP errors. It is intended to be used in middleware and handlers. Provided w, r and err should not be nil.
type HTTPError ¶
type HTTPError struct {
// Err is the internal error if any.
Err error
// Code is the preferred HTTP status code for the error.
// In most case, status code should be respected but not required.
// It must always be -1 or valid http status code such as [net/http.StatusOK].
// StatusCode -1 indicates that response should not be written or
// a response content is already written or the error is logging only.
// StatusCode is compared in [ProxyError.Is].
Code int
// Cause is the error cause of the error.
// It must always be non empty string.
// Cause is compared in [ProxyError.Is].
Cause string
// Details is the additional information
// of the error if any. It can be empty.
// Cause is not compared in [ProxyError.Is].
Detail string
}
HTTPError is the HTTP error type.
type HandlerFunc ¶
type HandlerFunc func(http.ResponseWriter, *http.Request)
HandlerFunc type is an adapter to allow the use of ordinary function as HTTP handlers. If f is a function with the appropriate signature, HandlerFunc(f) is http.Handler that calls f. HandlerFunc is the same as http.HandlerFunc.
Example:
var h http.Handler
h = HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte("ok"))
})
func (HandlerFunc) ServeHTTP ¶
func (f HandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Proxy ¶
type Proxy struct {
// Rewrite modifies proxy request.
// Client request if provided with in and the proxy request is provided with out.
// In must not be modified and at least out.URL must be configured for proxy target.
// Out request is created with in.Clone with the context of in.Context.
// out.Host is always empty and must not be filled.
// Hop-by-hop headers are removed from out before Rewrite is called.
// See also [net/http.Request.Host].
// Rewrite must not be nil, otherwise panics.
Rewrite func(in, out *http.Request)
// The transport used to perform proxy requests.
// If nil, [net/http.DefaultTransport] is used.
Transport http.RoundTripper
// PreRoundTrip is called just before roundtrip.
// Client request is provided as in and proxy request as out.
// In and out requests should not be modified.
// PreRoundTrip can be used for logging or hooking etc.
// If PreRoundTrip returned non-nil error, it is passed to
// the error handler.
PreRoundTrip func(in, out *http.Request) error
// PostRoundTrip is called just before roundtrip.
// Proxy request and response are provided as in and out each.
// PostRoundTrip can be used as response modifier.
// If PostRoundTrip returned non-nil error, it is passed to
// the error handler.
PostRoundTrip func(in *http.Request, out *http.Response) error
// ErrorHandler is the optional error handler.
// If non-nil, any errors occurred while proxying is given.
// If nil, a default error handler is used.
// Given w and r is the same as tha value passed to [Proxy.ServeHTTP].
ErrorHandler ErrorHandler
}
Proxy is the http proxy.
type ResponseWrapper ¶
type ResponseWrapper struct {
// StatusWritten is the callback function that will
// be called when a status code was written to the
// internal ResponseWriter.
StatusWritten func(statusCode int)
// contains filtered or unexported fields
}
ResponseWrapper wraps the net/http.ResponseWriter and make written status code and written body bytes accessible. Use WrapResponseWriter to wraps a response writer.
func WrapResponseWriter ¶
func WrapResponseWriter(w http.ResponseWriter) *ResponseWrapper
WrapResponseWriter wraps the w with ResponseWrapper.
func (*ResponseWrapper) Flush ¶
func (w *ResponseWrapper) Flush()
Flush calls Flush() method of the internal response writers. See also the comments on the net/http.NewResponseController.
func (*ResponseWrapper) FlushError ¶
func (w *ResponseWrapper) FlushError() error
FlushError calls FlushError() method of the internal response writers. It returns net/http.ErrNotSupported when the feature is not available. See also the comments on the net/http.NewResponseController.
func (*ResponseWrapper) Header ¶
func (w *ResponseWrapper) Header() http.Header
Header returns http header. See net/http.ResponseWriter.Header.
func (*ResponseWrapper) Hijack ¶
func (w *ResponseWrapper) Hijack() (net.Conn, *bufio.ReadWriter, error)
func (*ResponseWrapper) StatusCode ¶
func (w *ResponseWrapper) StatusCode() int
StatusCode returns a HTTP status code written to the response writer. If status code has not been written, it returns -1.
func (*ResponseWrapper) Write ¶
func (w *ResponseWrapper) Write(b []byte) (n int, err error)
Write writes the data to the response writer. See net/http.ResponseWriter.Write.
func (*ResponseWrapper) WriteHeader ¶
func (w *ResponseWrapper) WriteHeader(statusCode int)
WriteHeader writes http status code. See net/http.ResponseWriter.WriteHeader.
func (*ResponseWrapper) Written ¶
func (w *ResponseWrapper) Written() int64
Written returns the number of bytes written to the internal response writer. If nothing written, it returns 0.
type RoundTripperFunc ¶
RoundTripperFunc type is an adapter to allow the use of ordinary function as HTTP round tripper. If f is a function with the appropriate signature, RoundTripperFunc(f) is http.RoundTripper that calls f.
Example:
var r http.RoundTripper
r = RoundTripperFunc(func(r *http.Request) (*http.Response, error) {
// Some process.
return http.DefaultTransport.RoundTrip(r)
})
type ServerMiddleware ¶
ServerMiddleware is the server side middleware.
type ServerMiddlewareChain ¶
type ServerMiddlewareChain []ServerMiddleware
ServerMiddlewareChain is the middleware chain of ServerMiddleware. ServerMiddlewareChain implements the ServerMiddleware interface itself.
func (*ServerMiddlewareChain) Add ¶
func (c *ServerMiddlewareChain) Add(ms ...ServerMiddleware)
Add adds given middleware to the chain. Middleware are added at the end of the chain keeping the order. Note that nil middleware will cause an panic.
func (*ServerMiddlewareChain) AfterAll ¶
func (c *ServerMiddlewareChain) AfterAll(ms ...ServerMiddleware)
AfterAll inserts the ms after all existing middleware. That is, the given ms is inserted at the index from 1 to n. Note that nil middleware will cause an panic.
× ○ ○ ○ ○ ○ ○
┌──────┬──────┬──────┬──────┬─────┬────────┐
chain │ m[0] │ m[1] │ m[2] │ m[3] │ ... │ m[n-1] │
├──────┼──────┼──────┼──────┼─────┼────────┤
↑ ↑ ↑ ↑ ↑ ↑ ↑
index 0 1 2 3 4 n-1 n
func (*ServerMiddlewareChain) BeforeAll ¶
func (c *ServerMiddlewareChain) BeforeAll(ms ...ServerMiddleware)
BeforeAll inserts the ms before all existing middleware. That is, the given ms is inserted at the index from 0 to n-1. Note that nil middleware will cause an panic.
○ ○ ○ ○ ○ ○ ×
┌──────┬──────┬──────┬──────┬─────┬────────┐
chain │ m[0] │ m[1] │ m[2] │ m[3] │ ... │ m[n-1] │
├──────┼──────┼──────┼──────┼─────┼────────┤
↑ ↑ ↑ ↑ ↑ ↑ ↑
index 0 1 2 3 4 n-1 n
func (ServerMiddlewareChain) Handler ¶
func (c ServerMiddlewareChain) Handler(h http.Handler, ms ...ServerMiddleware) http.Handler
Handler returns a handler with middleware. Additional middleware is applied at the end of the chain but they are not registered to this middleware chain.
func (*ServerMiddlewareChain) Insert ¶
func (c *ServerMiddlewareChain) Insert(index int, ms ...ServerMiddleware)
Insert inserts the given middleware at the position of index. If index<=0, ms are added at the beginning of the chain. If index>=len(c), ms are added at the end of the chain. Note that nil middleware will cause an panic.
┌──────┬──────┬──────┬──────┬─────┬────────┐
chain │ m[0] │ m[1] │ m[2] │ m[3] │ ... │ m[n-1] │
├──────┼──────┼──────┼──────┼─────┼────────┤
↑ ↑ ↑ ↑ ↑ ↑ ↑
index 0 1 2 3 4 n-1 n
func (*ServerMiddlewareChain) InsertAll ¶
func (c *ServerMiddlewareChain) InsertAll(ms ...ServerMiddleware)
InsertAll inserts the ms between each middleware. That is, the given ms is inserted at the index from 0 to n. Inserting to an empty chain will be ms itself. Note that nil middleware will cause an panic.
○ ○ ○ ○ ○ ○ ○
┌──────┬──────┬──────┬──────┬─────┬────────┐
chain │ m[0] │ m[1] │ m[2] │ m[3] │ ... │ m[n-1] │
├──────┼──────┼──────┼──────┼─────┼────────┤
↑ ↑ ↑ ↑ ↑ ↑ ↑
index 0 1 2 3 4 n-1 n
func (ServerMiddlewareChain) ServerMiddleware ¶
func (c ServerMiddlewareChain) ServerMiddleware(next http.Handler) http.Handler
ServerMiddleware is the implementation of [ServerMiddleware.ServerMiddleware].
type ServerMiddlewareFunc ¶
ServerMiddlewareFunc type is an adapter to allow the use of ordinary function as server middleware. If f is a function with the appropriate signature, ServerMiddlewareFunc(f) is ServerMiddleware that calls f.
Example:
var m ServerMiddleware
m = ServerMiddlewareFunc(func(next http.Handler) http.Handler {
return HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// Some process.
next.ServeHTTP(w, r)
})
})
func (ServerMiddlewareFunc) ServerMiddleware ¶
func (f ServerMiddlewareFunc) ServerMiddleware(next http.Handler) http.Handler
type ServerRunner ¶
type ServerRunner struct {
// Server starts a server.
// Serve must not be nil.
Serve func() error
// Shutdown gracefully shutdowns the server.
// Shutdown must not be nil.
// It will be called only when the context given to
// the ServerRunner.Run is done.
// Otherwise, Shutdown is not called even the Server exited.
// Typically [http.Server.Shutdown] should be set.
Shutdown func(context.Context) error
// Close immediately closes a server.
// Unlike Shutdown, it should not block.
// Close, if non-nil, will be called only when shutdown timeout occurred.
// Typically [net/http.Server.Close] should be set.
// Note that the [net/http.Server.Shutdown] does not close remaining
// connection after shutdown timeout occurred but this Runner try to.
Close func() error
// ShutdownTimeout is the timeout duration applied
// for the Shutdown function.
// For ShutdownTimeout<=0, 30 seconds is used.
ShutdownTimeout time.Duration
}
ServerRunner runs a server with an ability of graceful shutdown. See the following usage example.
Example:
svr := &http.Server{Addr: ":8080"} // Register a handler.
r := &ServerRunner{
Serve: svr.ListenAndServe,
Shutdown: svr.Shutdown,
Close: svr.Close,
ShutdownTimeout: 30 * time.Second,
}
sigCtx, cancel := signal.NotifyContext(context.Background(),
os.Interrupt, syscall.SIGTERM)
defer cancel()
if err := r.Run(sigCtx); err != nil {
panic(err)
}
func (*ServerRunner) Run ¶
func (r *ServerRunner) Run(sigCtx context.Context) error
Run runs a server. A server will be shutdown when the sigCtx is done. It returns non-nil error if r.Serve returns non-nil error except for the http.ErrServerClosed. When a timeout occurred while shutting down, a context.DeadlineExceeded can be returned.