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