Created 07-15-2024 02:46 AM
Dears ,
Kindly note that I am trying to send InvokeHttp request as Get with the following body=
Created 07-15-2024 07:29 AM
Hi,
Can you elaborate more on the issue. For example are you getting an error? what is the status code of the response?I assume you are using InvokeHttp processor, Can you paste screenshot of the configuration you have ? What kind of API is it and are you sure this a GET API vs Others ? Have you tried to do the GET from pastman or curl ? was it successful?
It seems using body with Get API is not good idea after all per below links , so if its something developed internally you probably should re consider.
https://www.linkedin.com/pulse/using-body-http-get-method-still-bad-idea-danny-logsdon
https://www.baeldung.com/cs/http-get-with-body
Created 07-16-2024 02:30 AM
Dear,
Kindly note that I am using a GET request inside the InvokeHTTP processor. As mentioned above, in order to retrieve the desired data, I need to send a body with the GET request. However, it's working inside Postman.
When it comes to nifi apache 2.0.0 when i run the invokehttp processor(Get) queues remains empty with no errors since no body is sent with request.
while it works for other Get requests that need no body.
Is there a solution for this case with additional processes to be added ? or some configurations?
please advice?
Created 07-17-2024 10:30 PM
Dear,
Any updates?
Created 07-15-2024 08:14 AM
@Ali_12012
The documentation for InvokeHTTP states that only POST, PUT and PATCH http methods will sent with a body. The processor does not support sending a body with GET http method. Only supports headers.
You may need to build a custom processor for your use case or perhaps use one of the scripting processors to accomplish your use case.
Thank you,
Matt
Created 07-16-2024 02:33 AM
Dear Mattwho,
Please find the above reply from my side.
How is it possible to be fixed by some script process while invokehttp get request can not be sent with body?
Created 07-18-2024 05:40 AM
@Ali_12012
The InvokeHTTP processor utilizes the OkHTTP client library. This library does not support a body in a get request:
https://github.com/square/okhttp/issues/3154
I am not familiar myself with what other client libraries exist that support this method, but guessing there must be some out there since postman handles this for you.
The script process allows you to create a custom code that can use whatever client libraries you want. You could also build you own custom processor that utilizes some other client that may be able to identify that supports get with a body.
Sorry I can't be of more help here. As @SAMSAL shared, there are reason why this is not supported or standard convention. Postman does not adhere to those standards and lets you do what you want.
Please help our community thrive. If you found any of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "Accept as Solution" on one or more of them that helped.
Thank you,
Matt
Created 07-22-2024 03:06 PM
@Ali_12012 Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. Thanks.
Regards,
Diana Torres,Created 07-23-2024 11:09 PM
Dear Diana,
No, the above reply did not help me however I found a solution to my problem through internet.
Best Regards,
Ali.D
Created 10-29-2024 06:13 AM
Dear @Ali_12012 ,
I encountered the same problem as you, please tell me how you solved it?
Help me please with a solution.🙏