diet-request

0.0.3 • Public • Published

Diet-Request

With this module you can make internal or cross site requests.

Install:

npm install diet-request

Simple GET request example:

new Request({
	url : 'http://twitter.com/api/call',
	end: function(response){
		console.log(response);
	}
});

Request Parameters

{
	// required, string
	'url'		: 'http://google.com/', 
	
	// defaults to `GET`, `string
	'method'	: 'GET', 
	
	// defaults to `''`, required if request method is `POST`, `string`
	'data'		: {""}, 
	
	// defaults to `query.host`, `string`
	'host'		: 'google.com', 
	
	// defaults to `query.path`, `string`
	'path'		: '/',
	
	// defaults to `80` if http, `443` if https, `integer`
	'port'		: 80,
	
	// detaults to `[{'Content-Type': 'application/x-www-form-urlencoded'}]`, `array`
	'headers'	: [{'Content-Type': 'application/x-www-form-urlencoded'}]
}

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i diet-request

      Weekly Downloads

      2

      Version

      0.0.3

      License

      MIT

      Last publish

      Collaborators

      • adamhalasz