I am using the InvokeHTTP processor in Apache NiFi to call an API. I am writing the response using the PutFile processor. When the API returns a 200 status code, it works fine and writes the response. However, when the API returns a 400 or 500 status code, it writes the original input file instead. I want to capture and write the actual response body for 400 or 500 status codes instead of the input file. here is process:
here is InvokeHTTP processor:
Here is putfile processor:
if status 200 it write the response . I want write all response from api instead of input file if it has any status from api.
@enam I see you have used the correct InvokeHTTP processor which is used to send API requests and handle responses, including error codes 400, 500 etc.