https://github.com/afiestas/node-http-message
Small library to create HTTP Messages
https://github.com/afiestas/node-http-message
Last synced: 19 days ago
JSON representation
Small library to create HTTP Messages
- Host: GitHub
- URL: https://github.com/afiestas/node-http-message
- Owner: afiestas
- License: mit
- Created: 2015-03-15T13:36:48.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-26T01:21:13.000Z (over 9 years ago)
- Last Synced: 2025-06-11T19:39:04.981Z (23 days ago)
- Language: JavaScript
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/afiestas/node-http-message)
# node-http-message
Small library to create HTTP Messages.## What is supported
At this moment only http 1.0 is supported.
We do *not* do any sanity checks on the values passed to HTTPMessage, so it might happen that you end up with
GET request containing a body, or headers with the same name (Javascript is case sensitive while HTTP is not).##Syntax
```javascript
var HTTPMessage = require('http-message');
var msg = new HTTPMessage();
msg.setRequest("POST", "/some/path");
msg.setHeaders({"Connection": "Close", "Accept": "*/*"});
msg.setBody("MyBody");
var httpMessage = msg.render();
```