Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
accept headers/body content
  • Loading branch information
brycejech committed Oct 8, 2019
commit 5393c2b41d9fb293e08e56fb691a26128d3a370f
8 changes: 7 additions & 1 deletion src/OAuthClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,20 @@ OAuthClient.prototype.makeApiCall = function makeApiCall(params) {

const request = {
url: params.url,
method: 'GET',
method: params.method || 'GET',
headers: {
Authorization: `Bearer ${this.getToken().access_token}`,
Accept: AuthResponse._jsonContentType,
'User-Agent': OAuthClient.user_agent,
},
};

if (params.headers && typeof params.headers === 'object') {
request.headers = { ...request.headers, ...params.headers };
}

params.body && (request.body = params.body);

resolve(this.getTokenRequest(request));
}))).then((authResponse) => {
this.log('info', 'The makeAPICall () response is : ', JSON.stringify(authResponse, null, 2));
Expand Down