Multipart Including text/html

Hi

I am using screen-scraper to create pages in various MS OneNote notebooks. It works fine where the content is solely text/html but I want to embed files into the page and to do that I need to post multipart content. I am using scrapeablefile.forceMultipart( true ) which does exactly what you’d expect. The problem I have is that OneNote requires a part with the key “Presentation” and the Content-Type explicitly set to text/html.

I add the files I want to embed as file parameters, as well as the string parameter key “Presentation”. But the latter is not given a Content-Type and if I add that declaration at the very beginning of the string value OneNote graph rejects it has not have a content-type. I suspect it may be because there is a line break between the automatic declarations that SS adds and then the value of the parameter itself.

My question is: is there a way to explicitly set the content-type for the parts of
a multipart post?

I hope this all makes sense!

I'm not sure I follow. You

I'm not sure I follow. You can set a content type: https://support.screen-scraper.com/documentation/api/scrapeablefile/setcontenttype but I don't know a way to set multiple ones on one request.