subtext

2018-11-09 admin

subtext是什么

什么是subtext,HTTP payload parsing

subtext使用教程帮助文档

subtext

HTTP payload parser.

Build Status

Lead Maintainer: John Brett

subtext parses the request body and returns it in a promise.

Example

const Http = require('http');
const Subtext = require('subtext');

Http.createServer(async (request, response) => {

  const { payload, mime } = await Subtext.parse(request, null, { parse: true, output: 'data' });

  response.writeHead(200, { 'Content-Type': 'text/plain' });
  response.end(`Payload contains: ${JSON.stringify(payload)}`);

}).listen(1337, '127.0.0.1');

console.log('Server running at http://127.0.0.1:1337/');

API

See the API Reference

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-44930.html

文章标题:subtext

回到顶部