Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/afiestas/node-http-message

Small library to create HTTP Messages
https://github.com/afiestas/node-http-message

Last synced: about 1 month ago
JSON representation

Small library to create HTTP Messages

Awesome Lists containing this project

README

        

[![Build Status](https://travis-ci.org/afiestas/node-http-message.svg?branch=master)](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();
```