I am talking to a server that used HTTP strings to send me as follows:
/path/to/my/handler/?action-query&id=112&type=vca&info=ch=0&type=event&ev16[sts=begin (...)
Thus, the "info" GET parameter included the "=" and "&" characters. It was rather unorthodox, but nevertheless we wrote a parser for it. However, recently they decided to encode part of it, so now the line looks like this.
/path/to/my/handler/?action=query&id=112&type=vca&info=ch%3D0%26type%3Devent%26ev46[sts%3Dbegin (...)
This breaks up our parser, which expects a line similar to the first.
Is there any way to βde-encodeβ a string so that I can use the old code (so that it is not broken when re-writing the parser)?
According to the answer below, we can use urllib.unquote () to clear the line up. However, we rely on request.GET, which is customizable based on the first line. Is it possible to restore a GET object based on a new converted string or somehow force it to be reevaluated?
source share