URL encode problem in GET request

Source: Internet
Author: User

First of all, the Python requests module is really too simple, save a lot of transcoding and so on, but this is also a disadvantage, for me this foundation bad students let me know a lot of things should know.

URL encode:

  For the Get method, the data is concatenated to the requested URL as a parameter, such as: Http://localhost:8080/servlet?msg=abc (a very common garbled problem is about to occur, if the URL appears in Chinese or other special characters, , such as: http://localhost:8080/servlet?msg= Hangzhou, server side easy to get garbled), after the URL stitching, the browser will URL encode URL, and then sent to the server, URL The process of encode is to encode part of the URL as a character, encoded as a binary bytecode in some encoding (e.g., UTF-8,GBK, etc.), and then each byte is represented by a 3-character string "%xy", where XY is the two-bit hexadecimal representation of the byte.

URL encode problem in GET request

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.