8.1.0 • Published 2 years ago

@hapi/subtext v8.1.0

Weekly downloads
357,869
License
BSD-3-Clause
Repository
github
Last release
2 years ago

subtext

HTTP payload parser.

Build Status

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

Example

const Http = require('http');
const Subtext = require('@hapi/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

8.1.0

2 years ago

8.0.1

2 years ago

7.1.0

2 years ago

8.0.0

3 years ago

7.0.4

3 years ago

7.0.3

5 years ago

6.1.3

5 years ago

7.0.2

5 years ago

7.0.1

5 years ago

7.0.0

5 years ago

6.1.2

5 years ago

6.1.1

6 years ago

6.1.0

6 years ago