Permalink
Browse files

support for default headers

in apiconfig.json, you can add "headers" : {} to a config entry to use
default headers. Format is:

"header" : { "key1":"value1", "key2":"value2", ...  }
  • Loading branch information...
1 parent c67a665 commit 4f0a531d97a74c71cda301572fbf0e18775389d9 @MarceloEmmerich MarceloEmmerich committed Oct 12, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −1 app.js
  2. +1 −0 public/data/apiconfig.json
View
2 app.js
@@ -310,7 +310,7 @@ function processRequest(req, res, next) {
var paramString = query.stringify(params),
privateReqURL = apiConfig.protocol + '://' + apiConfig.baseURL + apiConfig.privatePath + methodURL + ((paramString.length > 0) ? '?' + paramString : ""),
options = {
- headers: {},
+ headers: apiConfig.headers,
protocol: apiConfig.protocol + ':',
host: baseHostUrl,
port: baseHostPort,
@@ -4,6 +4,7 @@
"protocol": "http",
"baseURL": "api.klout.com",
"publicPath": "/1",
+ "headers" : {},
"auth": "key",
"keyParam": "key"
},

0 comments on commit 4f0a531

Please sign in to comment.