[5.4] GET returns java.nio.charset.IllegalCharsetNameException: "utf-8" for some API calls

Using Katalon 5.4, some of our REST API calls are failing with the reason: “utf-8”. I retried this same command in 5.3 and it works as expected. The specific API is for retrieving a stored email from MailGun using basic authorization.

I tried many different options and combinations of Accept, Accept-Charset, and Content-Type, but keep getting the same error. If I change Accept to message/rfc2822 I get the same error but “ascii” instead of “utf-8”. The documentation for this API is here: Messages — Mailgun API documentation.

The full stacktrace is here:

(Stack trace: java.nio.charset.IllegalCharsetNameException: “utf-8”

at java.nio.charset.Charset.checkName(Charset.java:315)

at java.nio.charset.Charset.lookup2(Charset.java:484)

at java.nio.charset.Charset.lookup(Charset.java:464)

at java.nio.charset.Charset.forName(Charset.java:528)

at com.kms.katalon.core.testobject.impl.HttpTextBodyContent.(HttpTextBodyContent.java:71)

at com.kms.katalon.core.webservice.common.BasicRequestor.setBodyContent(BasicRequestor.java:214)

at com.kms.katalon.core.webservice.common.RestfulClient.response(RestfulClient.java:195)

at com.kms.katalon.core.webservice.common.RestfulClient.sendGetRequest(RestfulClient.java:79)

at com.kms.katalon.core.webservice.common.RestfulClient.send(RestfulClient.java:48)

at com.kms.katalon.controller.WebServiceController.sendRequest(WebServiceController.java:37)

at com.kms.katalon.composer.webservice.parts.RestServicePart$2$1.run(RestServicePart.java:132)

at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)



1 Like

We are also facing this issue. Please fix.

Thanks for your information. We will fix this as well as we roll out 5.4.1 within next week to cover some API issues.

Hi Caleb,

I do not know if it will help or not, but I noticed a strange thing when I caught approximately similar errors but only with POST requests that returned with a message about the wrong type of content.

The fact is that when you send a request, the content type changes automatically in the HTTP Header, depending on the type of the selected at the bottom of the HTTP Body tab.

For example,
if you specified in HTTP Header:
Content-Type: application / json; charset = utf-8, and on
the HTTP Body tab at the bottom will be selected "Text ", then when the query is executed,
HTTP header parameters will automatically be changed to Content Type: text / plain and those parameters that you specified earlier in HTTP Header will be ignored.

1 Like

The GET requests do not have that option, because the HTTP Body tab is disabled.