[API Testing] HTTP Body problem with Katalon 6.2.2 and linux

I am using Katalon Studio 6.2.2 in Ubuntu.

During some API testing, I realized I was able to do GET without any problem but POST always returned me status 400 - Bad Request.

After some analysis, I realized that, no matter what I wrote in the HTTP Body section of my Object (see following picture), the request Katalon was sending was always empty, giving me the Bad Request all the time.

Then, after a long analysis (and looking at some older files I had) I solved the issue by adding a new line inside the “.rs” file of my Object, like the image below:

Here is the line I added manually to the file:
"text": "{\n "message": "${message_string}"}",

Of course you need to adapt the line according to the content you want to send.
I am using a variable called message_string in order to send different messages in my request.

I am pretty sure this line should be added automatically once you fill in the “HTTP Body” tab of the interface and therefore, I am considering it a bug.
Maybe it has something to do with the fact that I am using linux or maybe some missing configuration but I found this workaround to make things work for me.

Please let me know it this is indeed a bug or if there is a way I can fix it in an easier way, since it is pretty annoying that every time I save my Object I have to edit the .rs file again because the line I added gets automatically deleted.

Hi @lsasaki,

Can you show us the HTTP Header Tab view? Did you try to add Content-Type as application/json in the HTTP Headers.

Thanks

Yes, I have tried, you can even see from the “.rs” file I sent, the content type is correct.

But here it is the Header Tab view:

And another try…

Hi @lsasaki,

Please share us the content of HAR file (at the top right of the response view).

Thanks

{
“log” : {
“version” : “1.2”,
“pages” : [ ],
“entries” : [ {
“startedDateTime” : “2019-08-05T18:46:35.434Z”,
“request” : {
“method” : “POST”,
“url” : “http://localhost:8080/api/v1/message”,
“httpVersion” : “”,
“cookies” : [ ],
“headers” : [ {
“name” : “Content-Type”,
“value” : “application/json”
} ],
“queryString” : [ ],
“postData” : {
“mimeType” : “application/json”,
“text” : “”,
“comment” : “”
},
“headersSize” : 0,
“bodySize” : 0,
“comment” : “”
},
“response” : {
“status” : 400,
“statusText” : “”,
“httpVersion” : “”,
“cookies” : [ ],
“headers” : [ {
“name” : null,
“value” : “HTTP/1.1 400 Bad Request”
}, {
“name” : “Access-Control-Allow-Origin”,
“value” : “*”
}, {
“name” : “Access-Control-Allow-Methods”,
“value” : “POST, PUT, GET, OPTIONS, DELETE”
}, {
“name” : “Content-Length”,
“value” : “0”
}, {
“name” : “Access-Control-Max-Age”,
“value” : “3600”
}, {
“name” : “Access-Control-Allow-Headers”,
“value” : “Content-Type, Authorization, Content-Length, X-Requested-With”
}, {
“name” : “Date”,
“value” : “Mon, 05 Aug 2019 18:46:35 GMT”
} ],
“content” : {
“size” : 0,
“mimeType” : “”,
“text” : “”,
“comment” : “”
},
“redirectURL” : “”,
“headersSize” : 250,
“bodySize” : 0,
“comment” : “”
},
“cache” : { },
“timings” : {
“comment” : “”,
“dns” : -1,
“send” : 0,
“wait” : 0,
“receive” : 0,
“ssl” : -1,
“blocked” : -1,
“connect” : 243
},
“comment” : “”,
“_katalonRequestInformation” : {
“name” : “0”,
“testObjectId” : “/home/lsasaki/Documents/EAP/eap-automated-api-tests/Object Repository/Hello World/Create Message.rs”,
“harId” : “bbbabb47-1317-479c-822a-dbae0b44893a”
},
“time” : 243
} ],
“comment” : “”
}
}

Hello,

I’m facing the same issue. Checked the .har file and found that request body is missing in the logs.

Katalon version : 6.3.3
Ubuntu version : 16.04

Facing the same issue. No matter what I do, all http requests (soap and rest) go out empty. Body is also never saved.

Katalon SE 7.6.2 running on Arch Linux

Hello. I am new to Katalon. I have downloaded Katalon Studio 7.6.2. I am using Ubuntu 18 system to run the studio. The HTTP Body for all POST/PUT methods are always empty. If i open up the .rs file, all the required lines are present. I have attached an image of my .rs file. Can someone please give me some guidance here?

Please has anyone found the solution to this?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.