Skip to content

Commit

Permalink
support for default headers
Browse files Browse the repository at this point in the history
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
MarceloEmmerich committed Oct 12, 2012
1 parent c67a665 commit 4f0a531
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app.js
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions public/data/apiconfig.json
Expand Up @@ -4,6 +4,7 @@
"protocol": "http",
"baseURL": "api.klout.com",
"publicPath": "/1",
"headers" : {},
"auth": "key",
"keyParam": "key"
},
Expand Down

0 comments on commit 4f0a531

Please sign in to comment.