简体   繁体   English

这是否意味着“任何MIME类型”?

[英]Does this mean “Any MIME type”?

In the AngularJS docu you can see the following default header added to each request: 在AngularJS文档中,您可以看到以下默认标头已添加到每个请求中:

Accept: application/json, text/plain, * / * 

I couldn't find what * / * means but I suppose it means ANY MIME TYPE. 我找不到* / *的意思,但我想它的意思是任何MIME TYPE。 Am I right? 我对吗? Sorry for the dumb question, but I couldn't find it explained anywhere... 很抱歉这个愚蠢的问题,但我在任何地方都找不到它的解释...

Many thanks. 非常感谢。

* / * actually is invalid; * / *实际上是无效的; whitespace is not allowed here (and it was actually a bug in the angular documentation) 这里不允许使用空格(这实际上是角度文档中的错误)

*/* however indeed means "any", see RFC 7231, Section 5.3.2 ( https://greenbytes.de/tech/webdav/rfc7231.html#rfc.section.5.3.2.p.2 ) */*但是实际上表示“任何”,请参阅RFC 7231,第5.3.2节( https://greenbytes.de/tech/webdav/rfc7231.html#rfc.section.5.3.2.p.2

Yes. 是。 From the HTTP specification: 根据HTTP规范:

"The asterisk * character is used to group media types into ranges, with "*/*" indicating all media types" “星号*字符用于将媒体类型分组为范围,其中“ * / *”表示所有媒体类型”

You can read the whole spec in RFC 7231 . 您可以阅读RFC 7231中的整个规范。

Yes, it means all mime types. 是的,这意味着所有的mime类型。 As you can see at HTTP 1.1 Standards . 如您在HTTP 1.1 Standards上所见。

The asterisk "*" character is used to group media types into ranges, with "*/*" indicating all media types and "type/*" indicating all subtypes of that type. 星号“ *”用于将媒体类型分组到范围内,其中“ * / *”表示所有媒体类型,“ type / *”表示该类型的所有子类型。 The media-range MAY include media type parameters that are applicable to that range. 媒体范围可以包括适用于该范围的媒体类型参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM