You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by rupert <ru...@verteego.com> on 2016/10/22 05:23:34 UTC

Posting file and form params as multipart/form-data

Hi, 

I've tried to figure out how to post a file that I picked up with the
GetFile processor as well as some additional params with a
multipart/form-data Content-Type.
I tried to use the InvokeHTTP and the PostHTTP method put if I send the
content of the file as message body the other params are not sent.

In CURL it works fine with this command:
curl -v -X POST -F "project-file=@/home/schiessl/demos/test_file.xlsx" -F
"format=binary/text/xml/xls/xlsx" http://requestb.in/1kurdbb1

Any ideas on that?

Rupert




--
View this message in context: http://apache-nifi-developer-list.39713.n7.nabble.com/Posting-file-and-form-params-as-multipart-form-data-tp13695.html
Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.

Re: Posting file and form params as multipart/form-data

Posted by Pierre Villard <pi...@gmail.com>.
Hi Rupert,

Could you give more details about how you have used InvokeHTTP processor?

The content of the incoming flow file will be used as content of the
request sent by InvokeHTTP processor and you can define all the parameters
in the processor.  What I am not sure to understand is "the other params
are not sent", what do you mean?

Thanks,
Pierre

2016-10-22 7:23 GMT+02:00 rupert <ru...@verteego.com>:

> Hi,
>
> I've tried to figure out how to post a file that I picked up with the
> GetFile processor as well as some additional params with a
> multipart/form-data Content-Type.
> I tried to use the InvokeHTTP and the PostHTTP method put if I send the
> content of the file as message body the other params are not sent.
>
> In CURL it works fine with this command:
> curl -v -X POST -F "project-file=@/home/schiessl/demos/test_file.xlsx" -F
> "format=binary/text/xml/xls/xlsx" http://requestb.in/1kurdbb1
>
> Any ideas on that?
>
> Rupert
>
>
>
>
> --
> View this message in context: http://apache-nifi-developer-
> list.39713.n7.nabble.com/Posting-file-and-form-params-
> as-multipart-form-data-tp13695.html
> Sent from the Apache NiFi Developer List mailing list archive at
> Nabble.com.
>