Mimic curl in python
问题 The following curl code works: curl --form addressFile=@t.csv --form benchmark=Public_AR_Census2010 http://geocoding.geo.census.gov/geocoder/locations/addressbatch t.csv is simply 1, 800 Wilshire Blvd, Los Angeles, CA, 90017 How do I mimic this in python. So far all of my attempts have resulted in 'Bad Requests'. I am also trying to keep everything in memory--no writing to file. One attempt: import requests url = "http://geocoding.geo.census.gov/geocoder/json/addressbatch" # data is csv like