npm.io
0.1.2 • Published 12 years ago

gracenode-request

Licence
MIT
Version
0.1.2
Deps
1
Vulns
2
Weekly
0

Request Module


Access

gracenode.request

Configurations N/A

.GET(url [string], requestParams [object], options [object*], callback [function])

Sends a GET request

Options

{
	// send extra headers
	headers: <object>,
	// set specific encoding
	encoding: <string>,
	// unzip the response body
	gzip: <boolean>
}

Example:

gracenode.request.GET('http://xxxx.com/aaa/bbb', { test: 1 }, null, function (error, body, status) {
	// do something
});
.POST(url [string], requestParams [object], options [object*], callback [function])

Sends a POST request

Options
{
	// send extra headers
	headers: <object>,
	// set specific encoding
	encoding: <string>,
	// unzip the response body
	gzip: <boolean>
}

Example:

gracenode.request.POST('http://xxxx.com/aaa/bbb', { test: 1 }, null, function (error, body, status) {
	// do something
});
.PUT(url [string], requestParams [object], options [object*], callback [function])

Sends a PUT request

Options
{
	// send extra headers
	headers: <object>,
	// set specific encoding
	encoding: <string>,
	// unzip the response body
	gzip: <boolean>
}

Example:

gracenode.request.PUT('http://xxxx.com/aaa/bbb', { test: 1 }, null, function (error, body, status) {
	// do something
});
.DELETE(url [string], requestParams [object], options [object*], callback [function])

Sends a DELETE request

Options
{
	// send extra headers
	headers: <object>,
	// set specific encoding
	encoding: <string>,
	// unzip the response body
	gzip: <boolean>
}

Example:

gracenode.request.DELETE('http://xxxx.com/aaa/bbb', { test: 1 }, null, function (error, body, status) {
	// do something
});

Keywords