Changeset 3305

Show
Ignore:
Timestamp:
12/17/09 15:10:42 (10 years ago)
Author:
cemeyer
Message:

#798: Fix httpretrieve to POST arbitrary strings.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • seattle/trunk/seattlelib/httpretrieve.repy

    r3290 r3305  
    458458    
    459459    # check if the given post data is valid 
    460     if not type(http_post) == dict: 
    461       raise HttpUserInputError('The given http_post is not a dictionary, given: ' + str(type(http_post))) 
    462  
    463     # change the given http post dictionary into a encoded post data with a key and val   
    464     try:  
    465       http_post = urllib_quote_parameters(http_post) 
    466     except Exception, e: 
    467       raise HttpUserInputError('Error encoding the given http post dictionary ' +  str(http_post) + str(e)) 
     460    if type(http_post) == dict: 
     461      # change the given http post dictionary into a encoded post data with a key and val   
     462      try:  
     463        http_post = urllib_quote_parameters(http_post) 
     464      except Exception, e: 
     465        raise HttpUserInputError('Error encoding the given http post dictionary ' +  str(http_post) + str(e)) 
     466 
     467    if type(http_post) != str: 
     468      raise HttpUserInputError('The given http_post is not a dictionary or string, given: ' + str(type(http_post))) 
     469 
    468470 
    469471