0.3.2 • Published 10 years ago

http-utility v0.3.2

Weekly downloads
48
License
-
Repository
github
Last release
10 years ago

http-utility

A wrapper for handling events around http requests and responses. This includes the following events:

request.connect
request.error
request.finish
request.socket

response.data
response.end
response.error

socket.connection
socket.error
socket.timeout

Install

npm install http-utility

Usage

Get Method

var Http = require('http-utility'),
    // See http://nodejs.org/api/http.html#http_http_request_options_callback
    options = {
        host: 'your-host-name'
    },
    request;

request = Http.get(options, function callback (error, data) {
    // do something
});

Post Method

var Http = require('http-utility'),
    // See http://nodejs.org/api/http.html#http_http_request_options_callback
    options = {
        host: 'your-host-name',
        path: 'your/post/path',
        post_data: {data: "your data"},
        headers: {
            'Content-Type': 'your/content',
            'Content-Length': 'your-data-length'
        }
    },
    request;

request = Http.post(options, function callback (error, data) {
    // do something
});
0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago