I'm trying to use http://www.camp.bicnirrh.res.in/featcalc/ to POST multipart/form-data via python 2.7. Specifically, I'm uploading a file (called 'Practice.txt') in FASTA format basically this format:
'>1(ENTER)STRINGOFSPECIFICCAPITALLETTERS'
to this site which also has a text box where you can also enter data manually (which I'm leaving blank). This data site also has checkbox options, of which I want to select 'Length', 'Net Charge', 'Aliphatic Index' and 'Hydrophobicity'. At the bottom of the page there is a 'Submit' button.
Currently, this is the code I've used for my POST response.
files = {'file': ('Practice.txt', open('Practice.txt', 'rb'))}
data = {'Length':'Length', 'Net Charge':'Net Charge', 'Aliphatic Index':'Aliphatic Index','Hydrophobicity':'Hydrophobicity'}
r = requests.post(url, files=files, data=data)
r.text
The problem is that none of this is coming back with any data when I do r.text. The website computes the values for all of these things when using the browser. I got WireShark, and I've been trying to look at the live feeds to see what exactly I'm sending to the server, and although I'm using the code above verbatim, it is not giving back the values that the browser would.
Does anyone have any ideas about why this might be happening/how to actually get data? Thanks for any input!