{"action":"created","issue":{"url":"https://api.github.com/repos/vpulim/node-soap/issues/813","repository_url":"https://api.github.com/repos/vpulim/node-soap","labels_url":"https://api.github.com/repos/vpulim/node-soap/issues/813/labels{/name}","comments_url":"https://api.github.com/repos/vpulim/node-soap/issues/813/comments","events_url":"https://api.github.com/repos/vpulim/node-soap/issues/813/events","html_url":"https://github.com/vpulim/node-soap/pull/813","id":144921751,"number":813,"title":"Avoids overwriting request headers with options in method invocation","user":{"login":"gabmontes","id":2621975,"avatar_url":"https://avatars.githubusercontent.com/u/2621975?v=3","gravatar_id":"","url":"https://api.github.com/users/gabmontes","html_url":"https://github.com/gabmontes","followers_url":"https://api.github.com/users/gabmontes/followers","following_url":"https://api.github.com/users/gabmontes/following{/other_user}","gists_url":"https://api.github.com/users/gabmontes/gists{/gist_id}","starred_url":"https://api.github.com/users/gabmontes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabmontes/subscriptions","organizations_url":"https://api.github.com/users/gabmontes/orgs","repos_url":"https://api.github.com/users/gabmontes/repos","events_url":"https://api.github.com/users/gabmontes/events{/privacy}","received_events_url":"https://api.github.com/users/gabmontes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-03-31T14:42:13Z","updated_at":"2016-03-31T18:06:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/vpulim/node-soap/pulls/813","html_url":"https://github.com/vpulim/node-soap/pull/813","diff_url":"https://github.com/vpulim/node-soap/pull/813.diff","patch_url":"https://github.com/vpulim/node-soap/pull/813.patch"},"body":"When specifying `options` during a method invocation, those options will be added to the set of options already defined to invoke `request` and call an endpoint as specified in the [docs](https://github.com/vpulim/node-soap#options-optional).\r\n\r\nBut if a `headers` option is specified, it will overwrite all the already-set request headers including, for instance, any auth header previously set:\r\n\r\n```javascript\r\nclient.MyService.MyPort.MyFunction({}, function(err, result) {\r\n  // the HTTP request will **only** have 'my-header' header!!\r\n}, {headers: {'my-header': 'header value'})\r\n```\r\n\r\nThis PR takes into consideration `headers` is a special case and, instead of overwriting the `headers` property, it will merge the properties into the existing request headers:\r\n\r\n```javascript\r\nclient.MyService.MyPort.MyFunction({}, function(err, result) {\r\n  // the HTTP request will have 'my-header' in addition to any other existing header\r\n}, {headers: {'my-header': 'header value'})\r\n```"},"comment":{"url":"https://api.github.com/repos/vpulim/node-soap/issues/comments/204059142","html_url":"https://github.com/vpulim/node-soap/pull/813#issuecomment-204059142","issue_url":"https://api.github.com/repos/vpulim/node-soap/issues/813","id":204059142,"user":{"login":"jsdevel","id":2605980,"avatar_url":"https://avatars.githubusercontent.com/u/2605980?v=3","gravatar_id":"","url":"https://api.github.com/users/jsdevel","html_url":"https://github.com/jsdevel","followers_url":"https://api.github.com/users/jsdevel/followers","following_url":"https://api.github.com/users/jsdevel/following{/other_user}","gists_url":"https://api.github.com/users/jsdevel/gists{/gist_id}","starred_url":"https://api.github.com/users/jsdevel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsdevel/subscriptions","organizations_url":"https://api.github.com/users/jsdevel/orgs","repos_url":"https://api.github.com/users/jsdevel/repos","events_url":"https://api.github.com/users/jsdevel/events{/privacy}","received_events_url":"https://api.github.com/users/jsdevel/received_events","type":"User","site_admin":false},"created_at":"2016-03-31T18:06:55Z","updated_at":"2016-03-31T18:06:55Z","body":"Looks good to me.  Thanks!"}}