Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
URL String with parameters
#12
I have found this:

 

import os
import sys 
from cgi import parse_qs, escape

def application (environ, start_response):
 
    d = parse_qs(environ['QUERY_STRING'])
 
    age = d.get('age', [''])[0] # Returns the first age value    age = escape(age)    
    hobbies = d.get('hobbies', []) # Returns a list of hobbies
    hobbies = [escape(hobby) for hobby in hobbies]
Reply


Messages In This Thread
URL String with parameters - by nikoloz - May-06-2020, 12:15 PM
RE: URL String with parameters - by pyzyx3qwerty - May-06-2020, 12:26 PM
RE: URL String with parameters - by nikoloz - May-06-2020, 12:31 PM
RE: URL String with parameters - by buran - May-06-2020, 12:35 PM
RE: URL String with parameters - by nikoloz - May-06-2020, 12:42 PM
RE: URL String with parameters - by buran - May-06-2020, 12:44 PM
RE: URL String with parameters - by nikoloz - May-06-2020, 01:12 PM
RE: URL String with parameters - by buran - May-06-2020, 01:09 PM
RE: URL String with parameters - by buran - May-06-2020, 01:13 PM
RE: URL String with parameters - by buran - May-06-2020, 01:32 PM
RE: URL String with parameters - by nikoloz - May-06-2020, 01:48 PM
RE: URL String with parameters - by nikoloz - May-09-2020, 02:13 PM
RE: URL String with parameters - by snippsat - May-09-2020, 03:04 PM
RE: URL String with parameters - by nikoloz - May-15-2020, 07:24 AM
RE: URL String with parameters - by DeaD_EyE - May-15-2020, 08:20 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020