title: 404 The application completed without reading the entire request body .net core 2.1.1
body: <p>For various reasons, I need to use .Net core 2.1. I have an ASPNET Console App with only a few classes. 
  I keep getting 404: "The application completed without reading the entire request body." I've actually seen this a good deal online, but none of the solutions offered have helped my case.</p>
  
  <p>I also tried setting up a GET request, and also got 404.</p>
  
  <p><a href="https://stackoverflow.com/questions/52130175/the-application-completed-without-reading-the-entire-request-body-net-core-2-1">The application completed without reading the entire request body, .net core 2.1.1</a> The answer to this question had the most relevant info, but still this does not help my case.</p>
  
  <p>I've attached my code. Thanks in advance!</p>
  
  <p>Program.cs:</p>
  
  <pre><code>    public class Program
      {
          public static void Main(string[] args)
          {
              CreateWebHostBuilder(args).Build().Run();
          }
  
          public static IWebHostBuilder CreateWebHostBuilder(string[] args) =&gt;
              WebHost.CreateDefaultBuilder(args)
                  .UseStartup&lt;Startup&gt;()
                  .UseSockets()
                  .UseUrls($"http://*:5001");
      }
  </code></pre>
  
  <p>Startup.cs:</p>
  
  <pre><code>    public class Startup
      {
  
          public Startup(IConfiguration configuration)
          {
              this.Configuration = configuration;
          }
  
          public IConfiguration Configuration { get; }
  
          public void ConfigureServices(IServiceCollection services)
          {
              services.AddMvc();
          }
  
          public void Configure(IApplicationBuilder app, IHostingEnvironment env)
          {
              if (env.IsDevelopment())
              {
                  app.UseDeveloperExceptionPage();
              }
  
              app.UseMvc();
          }
      }
  </code></pre>
  
  <p>Controllers/MessageController.cs:</p>
  
  <pre><code>    [Route("api/Message")]
      [ApiController]
      class MessageController : Controller
      {
          public MessageController() { }
  
          // POST api/Message
          [HttpPost]
          public StatusCodeResult PostAsync(string content)
          {
              Console.WriteLine($"Received message. Content: {content}");
              return this.StatusCode((int)HttpStatusCode.Created);
          }
      }
  </code></pre>
  
  <p>I then start up the app, and send a Postman request.</p>
  
  <p>Postman Request: </p>
  
  <pre><code>POST /api/Message HTTP/1.1
  Host: localhost:5001
  Content-Type: application/json
  User-Agent: PostmanRuntime/7.20.1
  Accept: */*
  Cache-Control: no-cache
  Postman-Token: [redacted]
  Host: localhost:5001
  Accept-Encoding: gzip, deflate
  Content-Length: 28
  Connection: keep-alive
  cache-control: no-cache
  
  {
      "content": "hello"
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/YDZiO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YDZiO.png" alt="enter image description here"></a></p>