6.0.12 • Published 4 months ago

subtext v6.0.12

Weekly downloads
142,199
License
BSD-3-Clause
Repository
github
Last release
4 months ago

subtext

HTTP payload parser.

Build Status

Lead Maintainer: John Brett

subtext parses the request body and exposes it in a callback.

Example

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

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

    Subtext.parse(request, null, { parse: true, output: 'data' }, (err, parsed) => {

        response.writeHead(200, { 'Content-Type': 'text/plain' });
        response.end('Payload contains: ' + parsed.payload.toString());
    });

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

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

API

See the API Reference

Warning for subtext on Node below v4.3.2

A Node bug in versions below Node v4.3.2 meant that the Buffer.byteLength function did not work correctly, and as such, using maxBytes options with multipart payloads will mistake the file buffer size to be incorrectly as bigger than it is. Your options here are either to upgrade to Node version greater than v4.3.2 or increase maxBytes to allow some error in calculation. Background info in this issue here.

5.1.3

4 months ago

6.0.12

5 years ago

5.0.1

5 years ago

6.0.11

6 years ago

6.0.10

6 years ago

6.0.9

6 years ago

6.0.8

6 years ago

6.0.7

7 years ago

6.0.6

7 years ago

6.0.5

7 years ago

6.0.4

7 years ago

6.0.3

7 years ago

6.0.1

7 years ago

6.0.0

7 years ago

5.0.0

7 years ago

4.4.1

7 years ago

4.4.0

7 years ago

4.3.0

8 years ago

4.2.2

8 years ago

4.2.1

8 years ago

4.2.0

8 years ago

4.1.0

8 years ago

4.0.5

8 years ago

4.0.4

8 years ago

4.0.3

8 years ago

4.0.2

8 years ago

4.0.1

8 years ago

4.0.0

8 years ago

3.0.2

8 years ago

3.0.1

8 years ago

3.0.0

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.0.0

10 years ago