2.0.1 • Published 9 years ago

hello-http v2.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

npm version

hello

A node http.request wrapper with some sugar like url, data and json parsing.

install

$ npm i hello-http

api

simple remote request

hello(method, url [, data], cb)

method string

url string

data object stringified to json by default and appropriate headers set. Optional

custom remote request or localhost

hello({method, hostname, headers [, port, path, data]}, cb)

method string

hostname string defaults to localhost

port number Required if requesting localhost. Defaults to 80

path string Defaults to /

data object or string. Parsed as json or urlencoded and appropriate headers set. Optional

headers object Will be empty unless data is set.

All options in the original api is supported.

cb(err, res)

err null or an error message

res.raw unparsed response. Includes headers and statuscodes.

res.data parsed json by default. Otherwise the body string.

test

$ npm test

Todos

  • tests
  • npm
  • use on gaston

licence

MIT

2.0.1

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

3.0.1

10 years ago

3.0.0

10 years ago

2.1.10

10 years ago

2.1.9

10 years ago

2.1.8

10 years ago

2.1.7

10 years ago

2.1.6

10 years ago

2.1.5

10 years ago

2.1.4

10 years ago

2.1.3

10 years ago

2.1.2

10 years ago

2.0.0

10 years ago

1.0.0

10 years ago