import requests
    
    params = {'firstname':'Ryan', 'lastname':'Mitchell'}
    r = requests.post("http://pythonscraping.com/files/processing.php", data=params)
    print(r.text)
    
    files = {'uploadFile':open('/Users/mubai/pic.png', 'rb')}
    r = requests.post("http://pythonscraping.com/files/processing2.php", files=files)
    print(r.text)
    

    参考:《Python网络数据采集》