知识卡片
媒体类型指导解码
Content-Type 描述收到的消息体应按哪种格式解释。application/json、image/png 对应完全不同的读取方式。带 +json 的自定义媒体类型说明底层可用 JSON 解码,业务结构仍由其专门契约定义。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Describing API responses 5.6 Media types (aka MIME) · 查看原书依据
HTTP is a multimedia protocol, and it can handle requests and responses in many different formats. To indicate what format the data is in, it includes a header, typically Content-Type, with a media type as its value. Media types, or Multipurpose Internet
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第05章《Describing API responses》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch05.htm,阅读块 107)
- 结论依据:原文将 Content-Type 和媒体类型注册联系起来。
- 原始内容:HTTP is a multimedia protocol, and it can handle requests and responses in many different formats. To indicate what format the data is in, it includes a header, typically Content-Type, with a media type as its value. Media types, or Multipurpose Internet