title: Why is this code giving me invalid content type from Request.Form? (ASP.NET Core)
body: <p>This is using ASP.NET Core 2.0 OnGet method of RazorPages.</p>
  
  <p>cs file:</p>
  
  <pre><code>using System;
  using Microsoft.AspNetCore.Mvc;
  using Microsoft.AspNetCore.Mvc.RazorPages;
  
  namespace CoreRazor2.Pages
  {
    public class IndexModel : PageModel
    {
      [BindProperty]
      public int result { get; set; }
      public void OnGet(string operationType)
      {
        string result;
        switch (operationType)
        {
          case "+":
            result = Request.Form["First"];
            break;
          case "-":
            result = "1";
            break;
          case "/":
            result = "2";
            break;
          case "*":
            result = "3";
            break;
        }
  
      }
    }
  }
  </code></pre>
  
  <p>cshtml file:</p>
  
  <pre><code>@page
  @model IndexModel
  @{
      ViewData["Title"] = "Calculator";
  }
  
  &lt;form method="GET"&gt;
  &lt;label&gt;First Value: &lt;/label&gt;
  &lt;input name="First"/&gt;
  &lt;br/&gt;
  &lt;br/&gt;
  &lt;label&gt;Second Value: &lt;/label&gt;
  &lt;input name="second"/&gt;
  &lt;br/&gt;
  &lt;br/&gt;
  &lt;input type="submit" name="operationType" value="+"/&gt;
  &lt;input type="submit" name="operationType" value="-"/&gt;
  &lt;input type="submit" name="operationType" value="*"/&gt;
  &lt;input type="submit" name="operationType" value="/"/&gt;
  &lt;/form&gt;
  @Model.result
  </code></pre>
  
  <p>When putting a value in the first form input and clicking on the "+" submit button, the program throws the following exception at Request.Form["First"]:</p>
  
  <pre><code>Exception has occurred: CLR/System.InvalidOperationException
  An exception of type 'System.InvalidOperationException' occurred in Microsoft.AspNetCore.Http.dll but was not handled in user code: 'Incorrect Content-Type: '
     at Microsoft.AspNetCore.Http.Features.FormFeature.ReadForm()
     at Microsoft.AspNetCore.Http.Internal.DefaultHttpRequest.get_Form()
     at CoreRazor2.Pages.IndexModel.OnGet(String operationType) in c:\Users\Administrator\Desktop\CoreRazor2\Pages\Index.cshtml.cs:line 17
     at Microsoft.AspNetCore.Mvc.RazorPages.Internal.ExecutorFactory.VoidHandlerMethod.Execute(Object receiver, Object[] arguments)
     at Microsoft.AspNetCore.Mvc.RazorPages.Internal.PageActionInvoker.&lt;InvokeHandlerMethodAsync&gt;d__29.MoveNext()
  </code></pre>
  
  <p>Does anybody have any idea why or could point me toward some helpful documentation?</p>