inflation
2018-11-10
admin
inflation是什么
什么是inflation,Easily unzip an HTTP stream
inflation使用教程帮助文档
inflation
Automatically unzip an HTTP stream.
API
var inflate = require('inflation')
inflate(stream, options)
Returns a stream that emits inflated data from the given stream.
Options:
encoding
- The encoding of the stream (gzip
ordeflate
). If not given, will look instream.headers['content-encoding']
.
Example
var inflate = require('inflation')
var raw = require('raw-body')
http.createServer(function (req, res) {
raw(inflate(req), 'utf-8', function (err, string) {
console.dir(string)
})
})
本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。
转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]
本文地址:https://www.javascriptcn.com/read-45050.html
文章标题:inflation