Support Questions
Find answers, ask questions, and share your expertise
Alert: Please see the Cloudera blog for information on the Cloudera Response to CVE-2021-4428

NiFi- Using InvokeHttp/postHttp processor to post PDF to server

NiFi doesn't seem to take -F as an input while invoking the following request:

curl -X POST "http://ipaddress:port/api/" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "pdf_file=@sample.pdf;type=application/pdf"

It seems to me that it is by default requesting in this format:

curl -X POST "http://ipaddress:port/api/" -H "accept: application/json" -H "Content-Type: multipart/form-data" -d "pdf_file=@sample.pdf;type=application/pdf"

Sending raw data instead of form data.

The API hence responds with error saying:

"400 Bad Request: The browser (or proxy) sent a request that this server could not understand."

Whereas Using PostHttp:

setting the same URL and content-type as application/form-data gives me 500 internal server error

server logs: readv() failed (104: Connection reset by peer) while reading upstream


New Contributor

Any luck solving this issue? Please post your workaround.

The above question and reply thread below were originally posted in the Community Help Track. On Fri May 24 03:19 UTC 2019, a member of the HCC moderation staff moved it to the Data Ingestion & Streaming Track. The Community Help Track is intended for questions about using the HCC site itself.

Bill Brooks, Community Moderator
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.