Created 06-03-2020 09:20 AM
Hi @renuu ,
You can use'HandleHttpRequest' to listen for incoming GET/POST request on specific port and respond back using 'HandleHttpResponse' processor.
Add one Http Context Map controller service and use the same in both processor to map request to response, thats it.
Take a look at the below sample configurations.
This HandleHTTPRequest listens for http requests on port 8888 & specifi path i.e /curlRequest.
'Allowed path' is optional, if you just want listen for any request then you ca remove that value.
HandleHTTPResponse responds to client with 201 response code and any content which is flowfile content.
Instead of curl command I have invoked above listener with another NiFi processor (which you can consider as client)
InvokeHttp processor with target end point as above HandleHTTPRequest host & port.
I am using host as localhost as I am invoking form Nifi (local) only.
For curl command form outside, you need to use your nifi host name instead of 'localhost'.
So that would be 'http://<hostname>':8888/curlRequest
All together -
Please ACCEPT the solution if it helps/resolves your problem.
Thanks
Mahendra