Trying to upload a datafile from R using httr
POST
. The following almost works but I need to specify the filename, e.g. "mydata.csv"
. How do I specify the filename? It's blank when it reaches the server.
POST(uri, body=list(y=upload_file(filename)))
In curl
one would specify it with a -F name=filename
as in :
curl -i -F name=test -F filedata=@localfile.jpg http://example.org/upload
How to POST multipart/related content with httr (for Google Drive API)