Request.RawUrl vs. Request.Url

后端 未结 5 760
感动是毒
感动是毒 2020-12-13 12:38

What is the difference between Request.RawUrl and Request.Url in ASP.NET?

5条回答
  •  旧巷少年郎
    2020-12-13 12:53

    The HttpRequest.RawUrl Property documentation describes the property value as:

    The raw URL is defined as the part of the URL following the domain information. In the URL string http://www.contoso.com/articles/recent.aspx, the raw URL is /articles/recent.aspx. The raw URL includes the query string, if present.

    The HttpRequest.Url Property documentation describes the property value as:

    A Uri object that contains the URL of the current request.

    See the Uri class documentation for its properties.

提交回复
热议问题