I have this RESTful API where the Content-Type is multipart/form-data
and I am attaching a JSON file in the form-data
Here is my function:
@ Keyword
def uploadAJsonFile (String fileName = “sample.json”) {
File file = new File("$exportDirPath/$fileName"’);
URLConnection connection = file.toURL().openConnection();
String mimeType = connection.getContentType();
assert(mimeType == 'application/json');
// Request.sendRequestRobust(findTestObject())
}
Even before passing the file into the RESTful API, the mimeType is already content/unknown
which is not the expected mime
Caused by: Assertion failed:
assert(mimeType == 'application/json')
| |
| false
content/unknown
The @Keyword mentioned above was working up until I upgraded to Katalon 7.4
Did anyone experienced the same thing? What did you do to get the correct mimeType for the file?
Thanks in advance!