title: Getting error " JSONP injected script did not invoke callback." using Angular 2 and Server ASP.NET core
body: <p>I am using Angular 2 at the client side and on the server side Asp.NET Web API core.</p>
  
  <p>I have made a simple post calls from Angular 2 client to ASP.NET core Web API as shown in the below code.</p>
  
  <pre><code>        this.http.
              post("/api/Patient", data, options)
              .map(res =&gt; res.json())
              .subscribe(
              res =&gt; this.CallBack(res),
              err =&gt; this.logError(err));
  </code></pre>
  
  <p>My server side ASP core WebAPI code is as shown below.</p>
  
  <pre><code>public IActionResult Post()
  {
  // I am using EF and inserting to DB
  // Till here everything works fine.
  return Ok(obj);
  }
  </code></pre>
  
  <p>When the post happens we get the below error </p>
  
  <blockquote>
    <p>net::ERR_CONNECTION_RESET</p>
  </blockquote>
  
  <p>The data gets inserted but when the object is about to be returned the server just refuses. Also when i went deep in to the error i saw the below. </p>
  
  <blockquote>
    <p>"JSONP injected script did not invoke callback."
    JSONP_ERR_WRONG_METHOD : "JSONP requests must use GET request method."
    JSONP_HOME</p>
  </blockquote>
  
  <p>In my local it works and some times it does crash.
  I am hosting currently on httpwww.smarterasp.net and on that server this error is frequent.</p>
  
  <p>Any pointers would be welcome. </p>