[英]JSON.parse() for an Object of type application/octet-stream
I have a JSON stream of type application/octet-stream
. 我有一个类型为
application/octet-stream
的JSON application/octet-stream
。 I need to parse this using JSON.parse()
or similar? 我需要使用
JSON.parse()
或类似的解析? How can I achieve this? 我该如何实现?
application/octet-stream
is the MIME type for "Uh, I dunno, it's some bytes". application/octet-stream
是“呃,我不知道,它是一些字节”的MIME类型。
Either you have JSON which hasn't been correctly labelled and you can simply use JSON.parse
as normal or you have something else and you need to identify what it is and why you have it. 要么拥有未正确标记的JSON,要么可以像往常一样简单地使用
JSON.parse
,或者有其他东西,则需要确定它是什么以及为什么拥有它。
This could be anything from "It is gzipped JSON that you need to gunzip before parsing as JSON" to "It is corrupted nonsense and you need to fix whatever is generating it". 可能是“解析为JSON之前需要先压缩成zip格式的JSON”到“它已被废掉并且您需要修复生成它的任何内容”之类的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.