Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Nifi InvokeHttp Content-Type with GET

Solved Go to solution

Nifi InvokeHttp Content-Type with GET

Contributor

The web service I'm calling requires the Content-Type header to be set to application/json, but it appears the InvokeHttp processor only sets this header if it is a POST or PUT request. Is there any way to set this header for GET requests?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Nifi InvokeHttp Content-Type with GET

Contributor

Thanks for the answer. What you posted didn't work, but I did play with and eventually got it. What I had to do was have an UpdateAttribute processor before my InvokeHTTP that sets an attribute called "Content-Type", then in InvokeHTTP, set "attributes to send" to "Content-Type" and it worked.

Thanks!

2 REPLIES 2
Highlighted

Re: Nifi InvokeHttp Content-Type with GET

Contributor
@Frank Maritato

Have you looked at adding a dynamic property? If you take a look here: https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.InvokeHTTP/

"Attributes to send" is where you will want this. So in your nifi processor it should look like the image attached, can you try that?

7504-screen-shot-2016-09-08-at-21656-pm.png

Re: Nifi InvokeHttp Content-Type with GET

Contributor

Thanks for the answer. What you posted didn't work, but I did play with and eventually got it. What I had to do was have an UpdateAttribute processor before my InvokeHTTP that sets an attribute called "Content-Type", then in InvokeHTTP, set "attributes to send" to "Content-Type" and it worked.

Thanks!

Don't have an account?
Coming from Hortonworks? Activate your account here