For general questions which aren't specifically about mod_wsgi, you are better 
off asking on StackOverflow. Also, these sorts of issues are usually handled by 
a Python web framework, so if you aren't using one and are trying to do things 
using raw WSGI, I would suggest you use something like Flask instead. Otherwise 
you are going to have to drop down and use the cgi module 
(https://docs.python.org/3/library/cgi.html 
<https://docs.python.org/3/library/cgi.html>) to pull the requests apart 
yourself.

Graham

> On 21 Feb 2022, at 10:29 pm, Luca <[email protected]> wrote:
> 
> Good morning to all,
> 
> I have a django application that calls my python3 wsgi application. I will 
> show you the code that simulates the behaviour. The 's' variable is what the 
> Django application is sending to the WSGI application.
> 
> 
> 
> s = b'--a14c2bff457276f4b7efca76188ae034\\r\\nContent-Disposition: form-data; 
> name="wkt"\\r\\n\\r\\nPOLYGON((662856.5265945033 
> 5105763.789928524,665349.894261506 5105553.082801735,665174.3049891819 
> 5104359.075749931,663594.0015382647 5104499.54716779,662856.5265945033 
> 5105763.789928524))\\r\\n--a14c2bff457276f4b7efca76188ae034\\r\\nContent-Disposition:
>  form-data; 
> name="id"\\r\\n\\r\\n94\\r\\n--a14c2bff457276f4b7efca76188ae034\\r\\nContent-Disposition:
>  form-data; 
> name="proxy_csv"\\r\\n\\r\\n/it/admin/ws_trento/proxy/94/csv/\\r\\n--a14c2bff457276f4b7efca76188ae034\\r\\nContent-Disposition:
>  form-data; name="user"\\r\\n\\r\\nLuca 
> Manganelli\\r\\n--a14c2bff457276f4b7efca76188ae034--\\r\\n'
> 
> 
> from urllib.parse import parse_qs
> 
> variable_list = parse_qs(s))
> print(variable_list)
> 
> 
> 
> the output is:
> 
> {b'--123456789\\r\\nContent-Disposition: form-data; name': 
> [b'"wkt"\\r\\n\\r\\nPOLYGON(())\\r\\n--a14c2bff457276f4b7efca76188ae034\\r\\nContent-Disposition:
>  form-data; 
> name="id"\\r\\n\\r\\n94\\r\\n--a14c2bff457276f4b7efca76188ae034\\r\\nContent-Disposition:
>  form-data; 
> name="proxy_csv"\\r\\n\\r\\n/test/94/csv/\\r\\n--a14c2bff457276f4b7efca76188ae034\\r\\nContent-Disposition:
>  form-data; 
> name="user"\\r\\n\\r\\ntestuser\\r\\n--a14c2bff457276f4b7efca76188ae034--\\r\\n']}
> 
> 
> 
> I see multiple Content-Disposition here that parse_qs is not able to 
> interpret and thus I do not have a dictionary object. Can you point me to a 
> solution to this problem?
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/modwsgi/CADyNUXBNxF7ZigTDXiTLphv_%2BfwQ-%2BUnjt3nkBJkN4Dihsw2EQ%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/modwsgi/CADyNUXBNxF7ZigTDXiTLphv_%2BfwQ-%2BUnjt3nkBJkN4Dihsw2EQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/modwsgi/EF611954-E177-4D1F-8BED-AB722D786211%40gmail.com.

Reply via email to