Get Request node has not “request body” field.
I want to send a Get request with this field.
Thanks for replies.
Hi @aminfazeli43 , this is normal as there’s not much body to send when doing a GET Request. The values are mostly sent via the URL via a query string/url parameters, or via the headers.
Can you show us what you are trying to achieve?
I want to run a curl like this:
curl -X GET http://a.a.a.a -H ‘myHeaders’ -d ‘myBody’
myBody variable has json foramt. I put myHeaders content into request headers. But what about myBody?
The GET node doesn’t seem to support this. You can use the HTTP Retriever instead:
Hi @aminfazeli43 , you usually do not send any body value via GET as I mentioned. The server would not parse anything from the body for a GET request. The values that are usually parsed are from the query string (URL parameters) or the Headers, so I am not sure what you are passing as “myBody”. There is no content/data to be sent via a GET request.
With a POST (and PUT) request, however, you can send data.
@bruno29a It’s generally perfectly valid (per the specs) to send content with a GET. Is it nice? Is it best practice? Is it common? Probably not. Still, e.g.
curl and the HTTP Retriever node supports this
Hi @qqilihq , yes I am aware that you can send data via GET requests, but it’s unconventional as I said. At least that’s what used to be the “standard” - it was one of the differences between a GET and a POST, and probably why the GET Request node from Knime does not support body value.
Indeed, Elasticsearch API does read content via some of its GET requests.
I was just trying to make sure that @aminfazeli43 was using the proper request.
It could be that Knime should support body value in its GET Request then, as it looks like some APIs do parse the body with GET Requests.
I have opened a feature request for the GET node. No promises on when it will happen, though.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.