Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Non-web exception. Exception origin (name of application or object): mscorlib. #12203

@iatmakdotcx

Description

@iatmakdotcx

Steps to Reproduce

  1. create a aspx file
<%@ Page Language="C#" AutoEventWireup="true" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpContext.Current.Response.Write(HttpContext.Current.Request.HttpMethod+"<br />");

            string PostData = System.Text.Encoding.UTF8.GetString(HttpContext.Current.Request.BinaryRead(HttpContext.Current.Request.TotalBytes));
            HttpContext.Current.Response.Write(PostData);
            HttpContext.Current.Response.End();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
        </div>
    </form>
</body>
</html>

2 :post a data
Content-Type: application/json
3.
1

Current Behavior

Expected Behavior

On which platforms did you notice this

[ ] macOS
[ √ ] Linux
[ ] Windows

Version Used: 5.18.0.225

Stacktrace

  at System.String.Substring (System.Int32 startIndex, System.Int32 length) [0x0001d] in <9718c917fb6a4fdc9b76065acd3d23d9>:0 
  at System.String.Substring (System.Int32 startIndex) [0x00008] in <9718c917fb6a4fdc9b76065acd3d23d9>:0 
  at System.Web.Script.Services.RestHandler..ctor (System.Web.HttpContext context, System.Type type, System.String filePath) [0x00019] in <d7827785d86d4319aff2ec631b5fd56f>:0 
  at System.Web.Script.Services.RestHandler.GetHandler (System.Web.HttpContext context, System.Type type, System.String filePath) [0x00000] in <d7827785d86d4319aff2ec631b5fd56f>:0 
  at System.Web.Handlers.ScriptModule.PostAcquireRequestState (System.Object sender, System.EventArgs e) [0x00068] in <d7827785d86d4319aff2ec631b5fd56f>:0 
  at System.Web.HttpApplication+<RunHooks>d__217.MoveNext () [0x00144] in <4dc7c6ddf9a24171bab3c4a7623d4af2>:0 
  at System.Web.HttpApplication+<Pipeline>d__225.MoveNext () [0x007f1] in <4dc7c6ddf9a24171bab3c4a7623d4af2>:0 
  at System.Web.HttpApplication.Tick () [0x00000] in <4dc7c6ddf9a24171bab3c4a7623d4af2>:0 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions