On May 6, 10:43 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> For this
> URL:http://www.utilitymill.com/api/xml/utility/get_Book_Data_by_ISBNs/13/...
>
> When I call web.input() I get this:
>
> "<Storage {'HTML': '',
> 'ISBNS': '9780596513986%0D%0A9780688128166'}>"
>
> So I'm wondering why the %0D%0A aren't converted into \r\n for me?
>
> Here's the relevant code:
>
> class Utility_Run:
> def GET(self,return_format,name,revision):
> """ """
> err=check_name_rev_exist(name,revision)
> if err:
> web.header('Content-Type', 'text/html')
> print 'ERROR: '+err
> return
> #get inputs from url encoded
> dinputs=web.input()
> web.debug(str(dinputs))
>
Some more info. Looking at web.ctx.env I see this is my query string:
'QUERY_STRING': 'HTML=&ISBNS=9780596513986%250D%250A9780688128166'
web.input is just calling this:
cgi.FieldStorage(environ=e, keep_blank_values=1)
where e = ctx.env.copy()
And stepping into the FieldStorage code, it indeed will not decode the
query string:
>>> from cgi import parse_qsl
>>> print
>>> parse_qsl('HTML=&ISBNS=9780596513986%250D%250A9780688128166',keep_blank_values=1,
>>> strict_parsing=0)
[('HTML', ''), ('ISBNS', '9780596513986%0D%0A9780688128166')]
Is this an issue with Python then? It just won't support newlines in
the query string? Has anyone used newlines in a GET request in a
query string before (as a counter example?)
-Greg
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---