通用字节响应类型? [英] A generic byte response type?

查看:53
本文介绍了通用字节响应类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个返回字节数组的 RESTful 服务.我知道几种与 HTTP 相关的响应类型,包括 text/html、application/xml 和 image/png(以及其他几种).我不知道与通用字节数组相关联的响应类型.

I am writing a RESTful service that returns an array of bytes. I know of several response types associated with HTTP, including text/html, application/xml, and image/png (among several others). I am unaware of a response type that would be associated with a generic array of bytes.

这样的响应类型存在吗?我不想将字节作为文本发送,而且图像类型似乎都不合适.是否有一种字节"类型表示字节数组?

Does such a response type exist? I don't want to send the bytes as text, and none of the image types seem appropriate. Is there a kind of "byte" type that represents an array of bytes?

有人请指教...

推荐答案

application/octet-stream 为此向 IANA 注册:

application/octet-stream is registered with IANA for this purpose:

octet-stream"子类型用于表示一个主体包含任意二进制数据.

The "octet-stream" subtype is used to indicate that a body contains arbitrary binary data.

它实际上是在 RFC 2046,第 4.5.1 节中定义的.

It is actually defined in RFC 2046, section 4.5.1.

这篇关于通用字节响应类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆