|
|
|
@ -3,6 +3,7 @@ var https = require("https"); |
|
|
|
var json = require("./json"); |
|
|
|
var url = require("url"); |
|
|
|
var util = require("util"); |
|
|
|
var _ = require('lodash'); |
|
|
|
|
|
|
|
/*section: client |
|
|
|
*comment: | |
|
|
|
@ -15,6 +16,7 @@ var client = function(){ |
|
|
|
this.api_key = null; |
|
|
|
this.app_key = null; |
|
|
|
this.proxy_agent = null; |
|
|
|
this.http_options = null; |
|
|
|
this.api_version = "v1"; |
|
|
|
this.api_host = "app.datadoghq.com"; |
|
|
|
}; |
|
|
|
@ -66,12 +68,12 @@ client.prototype.request = function(method, path, params, callback){ |
|
|
|
"query": query, |
|
|
|
}); |
|
|
|
|
|
|
|
var http_options = { |
|
|
|
var http_options = _.assign({ |
|
|
|
hostname: this.api_host, |
|
|
|
port: 443, |
|
|
|
method: method.toUpperCase(), |
|
|
|
path: path |
|
|
|
}; |
|
|
|
}, this.http_options); |
|
|
|
|
|
|
|
if(this.proxy_agent){ |
|
|
|
http_options["agent"] = this.proxy_agent; |
|
|
|
|