Skip to content

Instantly share code, notes, and snippets.

@jeyraof
Created April 5, 2013 23:50
Show Gist options
  • Save jeyraof/5323547 to your computer and use it in GitHub Desktop.
Save jeyraof/5323547 to your computer and use it in GitHub Desktop.
make http get parameter to dictionary.
__author__ = 'jaeyoung'
def make(url):
tmp = dict()
param_line = url.split("?")[1]
param_list = param_line.split("&")
for param in param_list:
par = param.split("=")
tmp[par[0]] = par[1]
return tmp
@jeyraof
Copy link
Author

jeyraof commented Apr 5, 2013

make http get parameter to dictionary like bottom.

param = make("abc.com/file.ext?name1=value1&name2=value2&name3=value3")

param
{
"name1" = "value1",
"name2" = "value2",
"name3" = "value3"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment