Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Nifi InvokeHttp Content-Type with GET

avatar
Rising Star

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

avatar
Rising Star

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!

View solution in original post

3 REPLIES 3

avatar
Rising Star
@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

avatar
Rising Star

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!

avatar
Explorer

Do you know how to retrieve the content type from the message properties when using ConsumeJMS?