{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Razor/issues/811","repository_url":"https://api.github.com/repos/aspnet/Razor","labels_url":"https://api.github.com/repos/aspnet/Razor/issues/811/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Razor/issues/811/comments","events_url":"https://api.github.com/repos/aspnet/Razor/issues/811/events","html_url":"https://github.com/aspnet/Razor/issues/811","id":168460851,"number":811,"title":"Can't send POST-request via json in script ","user":{"login":"deeplydippy","id":18574364,"avatar_url":"https://avatars.githubusercontent.com/u/18574364?v=3","gravatar_id":"","url":"https://api.github.com/users/deeplydippy","html_url":"https://github.com/deeplydippy","followers_url":"https://api.github.com/users/deeplydippy/followers","following_url":"https://api.github.com/users/deeplydippy/following{/other_user}","gists_url":"https://api.github.com/users/deeplydippy/gists{/gist_id}","starred_url":"https://api.github.com/users/deeplydippy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deeplydippy/subscriptions","organizations_url":"https://api.github.com/users/deeplydippy/orgs","repos_url":"https://api.github.com/users/deeplydippy/repos","events_url":"https://api.github.com/users/deeplydippy/events{/privacy}","received_events_url":"https://api.github.com/users/deeplydippy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-30T10:25:42Z","updated_at":"2016-07-30T17:52:57Z","closed_at":null,"body":"I want to send to API Controller POST-request using json.  But something going wrong.\r\nHere is my script in CSHTML:\r\n```\r\n<script>\r\n$.post(\"/api/Push/PushParticipantSubscription\", { presid: \"test\", idcookies: \"4\", agreement: true });\r\n</script>\r\n```\r\nHere is my API Controller:\r\n```\r\n    [Produces(\"application/json\")]\r\n    [Route(\"api/Push\")]\r\n    public class PushController : Controller\r\n    {\r\n\r\n        private readonly ApplicationDbContext _context;\r\n        public PushController(ApplicationDbContext context)\r\n        {\r\n            _context = context;\r\n        }\r\n\r\n        // POST api/Push/PushParticipantSubscription/\r\n        [HttpPost]\r\n        [Route(\"PushParticipantSubscription/\")]\r\n        public async Task<IActionResult> PushParticipantSubscription(string presid, string idcookies, bool agreement)\r\n        {\r\n            PushParticipantSubscription subs = new PushParticipantSubscription();\r\n            subs.OneSignalUserId = idcookies;\r\n            subs.PresentationId = presid;\r\n            subs.PushAgreement = agreement;\r\n            try\r\n            {\r\n                subs.ApplicationUser = _context.ApplicationUser.SingleOrDefault(p => p.UserName == User.Identity.Name);\r\n            }\r\n            catch\r\n            {\r\n                subs.ApplicationUser = null;\r\n            }\r\n            _context.Add(subs);\r\n            await _context.SaveChangesAsync();\r\n            return NoContent();\r\n        }\r\n    }\r\n```\r\nBut in table from DB nothing changes.Thank you for any help!"},"comment":{"url":"https://api.github.com/repos/aspnet/Razor/issues/comments/236379424","html_url":"https://github.com/aspnet/Razor/issues/811#issuecomment-236379424","issue_url":"https://api.github.com/repos/aspnet/Razor/issues/811","id":236379424,"user":{"login":"pranavkm","id":174281,"avatar_url":"https://avatars.githubusercontent.com/u/174281?v=3","gravatar_id":"","url":"https://api.github.com/users/pranavkm","html_url":"https://github.com/pranavkm","followers_url":"https://api.github.com/users/pranavkm/followers","following_url":"https://api.github.com/users/pranavkm/following{/other_user}","gists_url":"https://api.github.com/users/pranavkm/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavkm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavkm/subscriptions","organizations_url":"https://api.github.com/users/pranavkm/orgs","repos_url":"https://api.github.com/users/pranavkm/repos","events_url":"https://api.github.com/users/pranavkm/events{/privacy}","received_events_url":"https://api.github.com/users/pranavkm/received_events","type":"User","site_admin":false},"created_at":"2016-07-30T17:52:57Z","updated_at":"2016-07-30T17:52:57Z","body":"Could you file this bug in https://github.com/aspnet/Mvc? Doesn't look like there's a Razor specific issue here."}}
{"actor":{"display_login":"pranavkm"}}