decodificar una cadena codificada por urlen, o apache rechaza la URL debido a '/' en los parámetros

I am developing Mobile application which uses python in its server side(apache server) , I send some parameters to the server,and am sending these parameter after encoding two times ,(other wise apache gives 400 error due to a '/' in the encoded parameter). I came to this solution after reading the artículo

And my server in turn sends a request to another server using the same parameter, So i want to decode it in to its previous form.

Is there any way in python to decode the encoded parameters in python?

Or whether I move to the other solutions described in the above article.

preguntado el 02 de febrero de 12 a las 11:02

1 Respuestas

Utilizan unquote() desde urllib.parse (python 3.x) or urllib2 (python 2.x)

Respondido 02 Feb 12, 15:02

But if I encode a string with spaces and then decode it ,the deoded string not equal to the orginal one,it has an extra '+' symbol in place of spaces. - Jisson

Entonces algo (apache?) is doing extra work with the url because unquote(quote('a b c d')) returns 'a b c d' - Kimvais

python is expecting %20 as the space character encoding, although '+' is also valid. - craigb

maybe you should use unquote_plus - Sano J

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.