Unescape Python Strings From HTTP

前端 未结 3 1825
梦谈多话
梦谈多话 2020-11-28 13:26

I\'ve got a string from an HTTP header, but it\'s been escaped.. what function can I use to unescape it?

myemail%40gmail.com -> myemail@gmail.com
         


        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 14:12

    Yes, it appears that urllib.unquote() accomplishes that task. (I tested it against your example on codepad.)

提交回复
热议问题