I'm trying to upload a file to Chatter files using the REST API but I'm getting the following error :
Binary data included but file attachment information is missing. If providing rich JSON/XML input in multipart REST, make sure to include Content-Type header in the part.
here's the related code :
Part[] parts = {
new StringPart("fileName", "Test.7z"),
new StringPart("Content-Type","multipart/form-data; boundary=boundary_string"),
new FilePart("feedItemFileUpload", newContentFile)
};
I tried with Content-Type : application/json; charset=UTF-8 but it doesn't change anything.