{"comment":{"url":"https://api.github.com/repos/massa84/mendeley-javascript-sdk/comments/11926869","html_url":"https://github.com/massa84/mendeley-javascript-sdk/commit/918a6f2749aca11eb7d1cb90eb48be799ba07fd2#commitcomment-11926869","id":11926869,"user":{"login":"customcommander","id":681975,"avatar_url":"https://avatars.githubusercontent.com/u/681975?v=3","gravatar_id":"","url":"https://api.github.com/users/customcommander","html_url":"https://github.com/customcommander","followers_url":"https://api.github.com/users/customcommander/followers","following_url":"https://api.github.com/users/customcommander/following{/other_user}","gists_url":"https://api.github.com/users/customcommander/gists{/gist_id}","starred_url":"https://api.github.com/users/customcommander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/customcommander/subscriptions","organizations_url":"https://api.github.com/users/customcommander/orgs","repos_url":"https://api.github.com/users/customcommander/repos","events_url":"https://api.github.com/users/customcommander/events{/privacy}","received_events_url":"https://api.github.com/users/customcommander/received_events","type":"User","site_admin":false},"position":98,"line":98,"path":"lib/headers.js","commit_id":"918a6f2749aca11eb7d1cb90eb48be799ba07fd2","created_at":"2015-06-30T08:53:10Z","updated_at":"2015-06-30T08:53:10Z","body":"Have you considered chaining the calls?\r\n\r\n```javascript\r\nfunction headers() {\r\n    if ( !(this instanceof headers) ) {\r\n        return new headers();\r\n    }\r\n    this._headers = {};\r\n}\r\n\r\nheaders.prototype.accept = function (contenttype) {\r\n    this._headers['Accept'] = contentTypes[contenttype] || contenttype || '*/*';\r\n    return this;\r\n};\r\n\r\nheaders().accept('file').contentType('document');\r\n```\r\n\r\nOnly if that is useful of course."}}