#(orig: URLFetch Multipart POST fails to post Body?)
###Update 2:
So after much weeping and gnashing of teeth our Lord and Savior Mathematica deemed me worthy of figuring out (some of) what the hell was going on.
It turns out the body was being passed okay (or the multipart elements were, at least, which it turns out is sufficient). I was thrown for a loop because the "Parameters"
argument of URLFetch
was interfering with either the "Body"
or "Headers"
of my post call.
As an example I was doing a Google Drive upload and it looked like:
URLFetch[apiBase?uploadType=multipart,
"Method"->"POST",
"Parameters"->{uploadType->"multipart","access_token"-><MY_TOKEN>},
"MultipartElements"->{
{"metadata","application/json"}-><METADATA_BYTES>,
{"contentdata","text/plain"}-><CONTENTDATA_BYTES>
}
]
And that "Parameters"
interfered with something. By pushing the "access_token"
into the "Authorization"
header and removing the "Parameters"
field altogether I finally got it to work.
###Update: