# HttpMessage NotReadableException API

**URL:** <https://forum.katalon.com/t/httpmessage-notreadableexception-api/132381>\
**Category:** API Testing\
**Tags:** api-testing, katalon-studio\
**Created:** [May 31, 2024, 9:14am UTC](https://forum.katalon.com/t/httpmessage-notreadableexception-api/132381 "2024-05-31T09:14:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coldplays6371](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/coldplays6371/32/23870_2.png) [@coldplays6371](https://forum.katalon.com/u/coldplays6371)\
**Post date:** [May 31, 2024, 9:14am UTC](https://forum.katalon.com/t/httpmessage-notreadableexception-api/132381/1 "2024-05-31T09:14:17Z")

</div>

Dear All,

I have some issue. I set variable in an api object but when I hit from Katalon it give response 400 HttpMessageNotReadableException and when I hit without variable like norma date format it success, I still don’t get it, why when I set variable it get’s HttpMessageNotReadableException

 ![Screenshot 2024-05-31 at 16.11.05](https://europe1.discourse-cdn.com/katalon/original/3X/4/8/48bfa6e097601f8dea98d8965a0c6a16331c2cd8.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/katalon/original/3X/d/5/d55596ab02785a255798e87ede769734747b30c4.svg) [@system](https://forum.katalon.com/u/system)\
**Post date:** [May 31, 2024, 9:14am UTC](https://forum.katalon.com/t/httpmessage-notreadableexception-api/132381/2 "2024-05-31T09:14:17Z")

</div>

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

Thanks!

---

<div class="post-metadata">

**Author:** ![Elly\_Tran](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/elly_tran/32/21874_2.png) [@Elly\_Tran](https://forum.katalon.com/u/Elly_Tran)\
**Post date:** [June 3, 2024, 2:39am UTC](https://forum.katalon.com/t/httpmessage-notreadableexception-api/132381/3 "2024-06-03T02:39:38Z")

</div>

Hi @coldplays6371,

Welcome to our community. Which variable makes your test fail? Can you please share the code?

---

<div class="post-metadata">

**Author:** ![depapp](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/depapp/32/29178_2.png) [@depapp](https://forum.katalon.com/u/depapp)\
**Post date:** [October 9, 2026, 9:28am UTC](https://forum.katalon.com/t/httpmessage-notreadableexception-api/132381/4 "2026-10-09T09:28:26Z")

</div>

hi @coldplays6371

HttpMessageNotReadableException is spring saying the body is not valid json any more once your variable is in. with a date variable it is almost always one of two things.

one, double quotes. the body has “${date}” and the variable value already contains quotes, so the server sees "“2024-05-31"”. or the opposite, the variable is used without quotes and the value has none.

two, the variable is not a string. if the default value is something like `new Date()` the body ends up with Fri May 31 16:11:05 ICT 2024 instead of your format. format it first:

```groovy
new Date().format('yyyy-MM-dd')

```

easiest way to see which one it is: add `println request.getBodyContent().getText()` to the verification tab, run, and paste the body into a json validator. the broken character jumps out immediately.
