One of the suppliers that I work with provide an API that is used to inject transaction data. This API uses a GET request, where the transaction information is passed as JSON data within the HTTP body.
I appreciate that a GET request is not necessarily intended for this approach and is possibly why Katalon advises that the ‘GET method does not require body content’ when speciifying a GET request and clicking on HTTP body.
Postman does allow a GET request with a HTTP body; however given that I have utilised Katalon extensively for web testing, Katalon does remain my application preference, if it can be supported.
Is there a method by which this can currently be supported? If not, can I request this as an enhancement for a future release?
Hello, I tried adding a custom HTTP GET you mentioned but to no use.
It’s problematic even before adding data to HTTP body in the custom GET, the custom GET method (i will name it GET1) it’s not classified as any HTTP method from what I see, it get’s the classification CUST in Katalon and does not fit anywhere to any of the method types.
Using the method just created (GET1) on run you receive an Status: 400.
Using the predefined GET method it works fine. Status: 200.
Please advise me on how to set the method.
Note: I attached screenshots for used examples:
Any news on this[quote=“Daniel_Wilkinson, post:1, topic:17296, full:true”]
One of the suppliers that I work with provide an API that is used to inject transaction data. This API uses a GET request, where the transaction information is passed as JSON data within the HTTP body.
I appreciate that a GET request is not necessarily intended for this approach and is possibly why Katalon advises that the ‘GET method does not require body content’ when speciifying a GET request and clicking on HTTP body.
Postman does allow a GET request with a HTTP body; however given that I have utilised Katalon extensively for web testing, Katalon does remain my application preference, if it can be supported.
Is there a method by which this can currently be supported? If not, can I request this as an enhancement for a future release?
[/quote]
?
The project I work with needs a GET operation with a JSON body attached to it. I’ve tried doing the custom HTTP GET method as suggested in the comment above, but i dont understand how i can define that custom method as a GET.
I also tried creating a script and sending the request manually and doing some debugging, but it seems the body does not get attached to the GET request no matter what I try. I’ve added a debug option in the API itself to log the BODY i send to the endpoint, but in the logs it just came back empty. But for some reason the “.getBodyContent().contentLength” was reporting the correct length of the body.
It makes me think that adding a BODY to the GET method is just not possible in Katalon.
does any of you guys requesting this feature know a public rest api which needs such feature?
just an ideea, one may try to build programaticaly a POST reqest, then attempt to change it’s verb via RestRequestMethod property into GET and send it.
it may work or it may not, but without a certain api to try this i cannot do a POC … and i am lazy to search for it.
@santi_hutapea have you read my previous post?
how can we help you without an working public available example?
i hope you realise that GET request with attached body is not a common, neighter recommended practice (altough, for some obscure reasons accepted by specification)
that tells me nothing.
sorry, i won’t answer anymore on this topic, seems that is a serious lack of communication.
feel free to explore yourself the magic of programing.
Any news on this feature request or a workaround that won’t force me to use another tool…?
Recently run into this limitation myself testing for a client that has recently expanded their API with a GET request that requires a request body (list of ID’s too long for the URL).
Creating a custom API end-point through:
Project -> Settings -> Test Design -> API/Web Service Method
Is not a solution as the required rest method is ‘GET’
All my tests are code, as such I also attempted to set the ‘restRequestMethod’ to POST, build the request (both through RestRequestObjectBuilder and RequestObject directly), then change the restRequestMethod back to GET before sending the request with WS.sendRequest(ro)…
Which doesn’t work… It seems the moment GET is set as the rest method, the field “postData” (see .HAR files) is removed. Though it’s present for POST/PATCH/PUT/DELETE, where it contains the request body.
Other tools like postman, swagger, elasicsearch and so on all support GET requests with a body, I find it odd that a young tool like Katalon don’t support it. If a GET request should have a body is an entirely different conversation altogether (there are use-cases for it), Katalon as a testing tool should not limit whats possible to test. Especially since GET requests with a body are valid (wasn’t recommended in the past).
I’m on Katalon 7.2.1
If there does exist away that has eluded me, please hit me in the head with it.
Thanks.
I’m glad to let you know Katalon supports defining body content of RESTful API requests with methods other than POST/PUT/PATCH/DELETE in version 7.4.2, which can be downloaded here.