1
votes

I need to send the following GET request with JSON to https://www.example.com/api/

GET /path/to/data
{
 "abcd": [
   "a1",
   "a2"
   ]
}

Which is encoded in URL in such a way: https://www.example.com/api/path/to/data?json=%8B%0B%+.....

I tried to accomplish this request via these two NiFi flows:

  1. GenerateFlowFile -> ReplaceText -> UpdateAttribute -> InvokeHTTP -> PutFile

  2. GenerateFlowFile -> UpdateAtribute -> AttributeToJSON -> InvokeHTTP -> PutFile

However, I fail to send the JSON with the request. Could you please give me a hint on how to configure these processors or suggest a different NiFi flow? (I also need to use Basic Authentication, that's the reason why I use InvokeHTTP processor)

Thank you in advance for any replies.

2

2 Answers

0
votes

You need to use GetHTTP processor for this purpose

0
votes

Well, you can't. Since GET request with body is not popular and many avoid that(for stupid reasons) - GET with body is not supported by many frameworks(NiFi amongst them.)

So neither GetHTTP(which any way wouldn't help you since it doesn't accept incoming relationships) nor InvokeHTTP would help you. You'll probably be able to do this using ExecuteScript developing something of your own.