Webutility (provides a way to encode and decode URLs when processing WEB requests. )

Source: Internet
Author: User
Tags urlencode

public static string UrlEncode (String str)

urlencode (String)   method can be used to encode the entire URL, including query string values.   If there are no encoding cases, such as spaces and punctuation characters passed in an HTTP stream, they may be incorrectly interpreted on the receiving side.  url encoding is converted to the character entity equivalent; The character URL in the URL is not allowed to decode the reversed encoding.   For example, when character < and > are embedded in a block of text to be transferred in the URL, they are encoded as%3 C and%3e.

You can encode the URLs that you useUrlEncode method or Urlpathencode method. However, these methods return different results. The UrlEncode method converts each space character to a plus character (+).

HttpUtility. The UrlEncode method uses UTF-8 encoding by default. Therefore, the UrlEncode method is used to provide the same result as the UrlEncode method and to specify UTF8 as the second parameter.

Webutility (provides a way to encode and decode URLs when processing WEB requests. )

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.