[ 
https://issues.apache.org/jira/browse/NIFI-7394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17091655#comment-17091655
 ] 

Otto Fowler edited comment on NIFI-7394 at 4/24/20, 3:17 PM:
-------------------------------------------------------------

OK,
So what I would propose is this:

InvokeHttp be changed to support dynamic properties ( properties that you can 
add in the editor ) with a prefix name of FORM:NAME, where NAME is the name of 
a form data part.
The property value will be the value for that part if it is not the flow file 
content.
If the property value is not set, the flow file content will be set with that 
name, using the content type etc.

SO the logic would be :

IF WE HAVE DYNAMIC PROPERTIES WITH FORM PREFIX : MULTIPART IS TRUE
FOR EACH FORM:$, ADD FORM DATA PART
IF VALUE THEN VALUE ELSE FLOWFILE BYTES




was (Author: ottobackwards):
OK,
So what I would propose is this:

InvokeHttp be changed to support dynamic properties ( properties that you can 
add in the editor ) with a prefix name of FORM:NAME, where NAME is the name of 
a form data part.
The property value will be the value for that part if it is not the flow file 
content.
If the property value is not set, the flow file content will be set with that 
name, using the content type etc.



> InvokeHTTP Processor is not supporting multipart/form-data
> ----------------------------------------------------------
>
>                 Key: NIFI-7394
>                 URL: https://issues.apache.org/jira/browse/NIFI-7394
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>         Environment: NiFi v1.10, v1.9.1 and v1.7
>            Reporter: Sudhanthiran B
>            Priority: Major
>              Labels: InvokeHTTP, multipart/form-data
>
>     The InvokeHTTP processor does not support invoking a multipart/form-data. 
> Unfortunately, I cannot share the URL or the data which I used but the 
> general theme is an API that accepts a file through a document browser or an 
> API that accepts input in form of custom forms.
>     I am trying to post the form data via API. Like I did in this curl 
> command. When I do the same via InvokeHTTP it fails.
> Curl method:
> {code:java}
> -sSk;--request;POST;--header;Content-Type:multipart/form-data;--header;Authorization:${Authorization};--form;extension=${extension};--form;name=${name};--form;entityId=${entityId};--form;entityTypeId=1;--form;type=${type};--form;version=${version};--form;comment=Uploaded
>  
> .;--form;financial=${modeType};--form;documentFileData=@/home/tomcat7/sample_path/${filename};${URL}/document/upload
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to