payload: {"action":"created","issue":{"url":"https://api.github.com/repos/nabinked/NToastNotify/issues/59","repository_url":"https://api.github.com/repos/nabinked/NToastNotify","labels_url":"https://api.github.com/repos/nabinked/NToastNotify/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/nabinked/NToastNotify/issues/59/comments","events_url":"https://api.github.com/repos/nabinked/NToastNotify/issues/59/events","html_url":"https://github.com/nabinked/NToastNotify/issues/59","id":420779240,"node_id":"MDU6SXNzdWU0MjA3NzkyNDA=","number":59,"title":"Ajax call - TypeError: response.headers is undefined","user":{"login":"dotnetshadow","id":296247,"node_id":"MDQ6VXNlcjI5NjI0Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/296247?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnetshadow","html_url":"https://github.com/dotnetshadow","followers_url":"https://api.github.com/users/dotnetshadow/followers","following_url":"https://api.github.com/users/dotnetshadow/following{/other_user}","gists_url":"https://api.github.com/users/dotnetshadow/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnetshadow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnetshadow/subscriptions","organizations_url":"https://api.github.com/users/dotnetshadow/orgs","repos_url":"https://api.github.com/users/dotnetshadow/repos","events_url":"https://api.github.com/users/dotnetshadow/events{/privacy}","received_events_url":"https://api.github.com/users/dotnetshadow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-03-14T00:29:10Z","updated_at":"2019-03-18T00:46:54Z","closed_at":null,"author_association":"NONE","body":"Hi there,\r\n\r\nI have the following ajax call:\r\n\r\n```javascript\r\n$.ajax({\r\n                            url:  'some-url',\r\n                            //dataType: 'json',\r\n                            type: 'POST',\r\n                            data: data,\r\n                            async: true,\r\n                            cache: false,\r\n                            headers: {\r\n                                'X-XSRF-TOKEN': serviceEndpoints.xsrfToken\r\n                            }\r\n                        })\r\n                        .done(function (result, textStatus, jqXHR) {\r\n\t                        var messages = window.nToastNotify.getMessagesFromFetchResponse(result);\r\n\t                        window.nToastNotify.showMessages(messages);\r\n                        }); \r\n```\r\n\r\n```csharp\r\n[HttpPost(\"[action]\"]\r\n        public async Task<IActionResult> DeleteFoo(int id)\r\n        {\r\n                      \r\n            var result = await _service.DeleteFoo(id);\r\n\r\n            _toastNotification.AddSuccessToastMessage(\"Foo Deleted\", new ToastrOptions\r\n            {\r\n                Title = \"Success\",\r\n                CloseButton = true,\r\n                CloseOnHover = false,\r\n                PositionClass = ToastPositions.BottomFullWidth,\r\n                PreventDuplicates = true,\r\n                ShowMethod = \"slideDown\",\r\n            });\r\n\r\n            return Content(\"AJAX\");\r\n            //return Ok(Json(result));\r\n        }\r\n```\r\nThe ajax call runs fine, I see the toastr pop up but I see an error in the browser console:\r\n`TypeError: response.headers is undefined`\r\n\r\nIt's complaining about the following code:\r\n```javascript\r\nNToastNotify.prototype.getMessagesFromFetchResponse = function (response) {\r\n        var messageStr = response.headers.get(this.options.responseHeaderKey);\r\n        if (messageStr) {\r\n            return JSON.parse(messageStr);\r\n        }\r\n        else {\r\n            return null;\r\n        }\r\n    };\r\n```\r\n\r\n**UPDATE**\r\nIt seems the error is caused because I was calling \r\n`\r\nvar messages = window.nToastNotify.getMessagesFromFetchResponse(result);\r\n\t                        window.nToastNotify.showMessages(messages);\r\n`\r\n\r\nIf I remove these lines, the toastr still comes up so not sure what's happening in regards to ajax calls, I thought I would have to use the above lines for the toastr to work?\r\n"},"comment":{"url":"https://api.github.com/repos/nabinked/NToastNotify/issues/comments/473733464","html_url":"https://github.com/nabinked/NToastNotify/issues/59#issuecomment-473733464","issue_url":"https://api.github.com/repos/nabinked/NToastNotify/issues/59","id":473733464,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3MzczMzQ2NA==","user":{"login":"dotnetshadow","id":296247,"node_id":"MDQ6VXNlcjI5NjI0Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/296247?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnetshadow","html_url":"https://github.com/dotnetshadow","followers_url":"https://api.github.com/users/dotnetshadow/followers","following_url":"https://api.github.com/users/dotnetshadow/following{/other_user}","gists_url":"https://api.github.com/users/dotnetshadow/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnetshadow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnetshadow/subscriptions","organizations_url":"https://api.github.com/users/dotnetshadow/orgs","repos_url":"https://api.github.com/users/dotnetshadow/repos","events_url":"https://api.github.com/users/dotnetshadow/events{/privacy}","received_events_url":"https://api.github.com/users/dotnetshadow/received_events","type":"User","site_admin":false},"created_at":"2019-03-18T00:46:54Z","updated_at":"2019-03-18T00:46:54Z","author_association":"NONE","body":"Ahh ok thanks for clearing that up, I guess I was a little confused. "}}
other: {"actor":{"display_login":"dotnetshadow"}}