コード例 #1
0
ファイル: Utils.py プロジェクト: artwebs/awspy
def http_queryobject(httpMap):   
    querystring="";
    regex = re.compile(".+\?(.+)", re.IGNORECASE)
    out=regex.findall(httpMap.getvalue("HTTP_QUERY_STRING"))
    if len(out)>0:
        querystring="&"+out[0]
    if  httpMap.getvalue("HTTP_POST_VARS")!="":
        querystring="&"+httpMap.getvalue("HTTP_POST_VARS")
        
    regex = re.compile("&(\w+)=([^&]+)", re.IGNORECASE)
    out=regex.findall(querystring)
    queryobject=BinMap()
    queryobject.clear()
    for i in range(len(out)):
        queryobject.put(out[i][0], out[i][1])
    return queryobject