Skip to main content

Hi FME-community,

I want to use the HTTPCaller to upload two JSON-files in one multipart PUT request. Just using two HTTPCallers separately works fine with Headers defining content-type application/json and Upload Data to Specify Upload Body with the JSON-content in the Upload Body.

However, in future it will be convenient to also add different file-types in one PUT. Therefore I have the following Multipart PUT request:

As you can see in the example I leave the Content Type blank, because there's no option "multipart/mixed", but consequently it interprets the upload body as plain text resulting in a binary file uploaded.

Without success I also tried to set Upload data to multipart/form data with two separate String Uploads which results in the following error: "This FME edition does not recognize the `' function. Please ensure that the current platform supports this function, the function name is spelled correctly, and that you have installed all required plug-ins".

Do you know a solution for these problems or might know an FME-alternative for what I'm trying to do?

Thanks in advance,

Jan

I'll suggest you first use SoapUI to build a correct request. After that try to create the same request in FME. You can use Fiddler to see the differences in requests. Good luck!


Hi @geojan,

The HTTPCaller can do multipart PUTs and POSTs. Please set the Upload Data setting to Multipart / Form Data, then set the part sources in the Multipart Upload settings.


Hi @stalknecht, @DaveAtSafe,

Thanks for your responses! I tried to PUT my content with Postman (I think similar to SoapUI), which worked fine:

The only difference with my HTTPCaller PUT-request is that I cannot set my Upload Body to raw Text:

I also tried to separate the PUT-request in two JSONs, but also this option gives errors. Both the debugging log as Fiddler doesn't give enough info for me to solve the issue yet.

Apparently FME is not able to perform such upload?


I have something similar. I make a postrequest that combines the upload of a file and an xml (each with their own mimi-type). Hence,in the httpcaller I set ‘Upload Data’ to ‘Multipart / Form Data'. 

However the api returns “Bad Request</summary><detail>Content type 'multipart/form-data;' not supported”, as it expects multipart/mixed (I assume). 

The multipart/form data seems to overrule a Content-Type header with multipart/mixed. Is there a way to make such a combined request with multipart/mixed instead of Multipart / Form Data?

Thanks a lot. 

 


Reply