New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add non-binary file list option to make_form? #93
Comments
Did you read the section on posting forms from the vignette? The |
Hmm reading the SO, maybe I don't fully understand the question. Let me look into it better. |
Thanks for the quick reply. Yeah, I think what I'm describing is something between a simple character like curl_formadd(&post, &last, CURLFORM_COPYNAME, name, CURLFORM_COPYCONTENTS, translateCharUTF8(asChar(val)), CURLFORM_END); and a form file like curl_formadd(&post, &last, CURLFORM_COPYNAME, name, CURLFORM_FILE, path, CURLFORM_CONTENTTYPE, content_type, CURLFORM_END); As mentioned above, I'm not even sure this will solve the problem so if you have any other ideas I'm open to them! Thanks |
I don't think there is a distinction between binary and non-binary data inside a multipart body. I think Only multipart encoding supports setting a content type, from your example:
If you post a So I'm not sure what exactly it is that you want, but from your SO post it kind of looks like a bug on in the salesforge API? |
I guess, more to the point, I'm wondering if the multipart body could have a part with the header
This doesn't seem possible with
if I use
if I It's certainly possible that Salesforce API has a bug, it just seems unlikely to me given how many organizations use it and how this operation is documented. |
OK I get it now. You want to set a |
Yep! Sorry that wasn't very clear before. Do you think that might solve the issue? It's the only obvious mismatch I can see between Salesforce's example and mine. I can also imagine that functionality would be useful more generally, but I don't know enough about Curl to have a good sense. |
OK I have added a new function install.packages("https://github.com/jeroenooms/curl/archive/master.tar.gz", repos = NULL) And then look at |
Beautiful! Worked like a charm. I really appreciate the help and speed in execution |
Just closing the loop, |
This is more of a question than a request, as I may just be missing something...
I think it might be useful to be able to define the content-type for a non-binary element of a multipart form. Basically, I have this issue with binary & non-binary parts and I have a hunch that defining an intermediate case in
make_form
could do the trick:The idea is that I could pass a string with a defined content-type (similar to the second example here):
I couldn't get a local build of
curl
with this tweak to work, but I'm not at all confident writing C code. On the other hand this may not even be relevant to solve the issue. Any suggestions?The text was updated successfully, but these errors were encountered: