|
|
|
@ -3,7 +3,6 @@ var https = require("https"); |
|
|
|
var url = require("url"); |
|
|
|
var util = require("util"); |
|
|
|
|
|
|
|
|
|
|
|
/*section: client |
|
|
|
*comment: | |
|
|
|
* the constructor for _client_ object |
|
|
|
@ -14,6 +13,7 @@ var util = require("util"); |
|
|
|
var client = function(){ |
|
|
|
this.api_key = null; |
|
|
|
this.app_key = null; |
|
|
|
this.proxy_agent = null; |
|
|
|
this.api_version = "v1"; |
|
|
|
this.api_host = "app.datadoghq.com"; |
|
|
|
}; |
|
|
|
@ -69,9 +69,12 @@ client.prototype.request = function(method, path, params, callback){ |
|
|
|
hostname: this.api_host, |
|
|
|
port: 443, |
|
|
|
method: method.toUpperCase(), |
|
|
|
path: path, |
|
|
|
path: path |
|
|
|
}; |
|
|
|
|
|
|
|
if(this.proxy_agent) |
|
|
|
http_options["agent"] = this.proxy_agent; |
|
|
|
|
|
|
|
if(["POST", "PUT"].indexOf(http_options["method"]) >= 0){ |
|
|
|
http_options["headers"] = { |
|
|
|
"Content-Type": "application/json", |
|
|
|
|