Not able to upload files in rest api using katalon

Hello Support,

I have the latest version of Katalon studio (5.4) and with this release katalon has stated supporting file upload, but this feature does not work for me.

When I try to upload a document I am getting an error as

org.jvnet.mimepull.MIMEParsingException: Missing start boundary at org.jvnet.mimepull.MIMEParser.skipPreamble(MIMEParser.java:318)

    at org.jvnet.mimepull.MIMEParser.access$300(MIMEParser.java:68)

    at org.jvnet.mimepull.MIMEParser$MIMEEventIterator.next(MIMEParser.java:154)

    at org.jvnet.mimepull.MIMEParser$MIMEEventIterator.next(MIMEParser.java:132)

    at org.jvnet.mimepull.MIMEMessage.makeProgress(MIMEMessage.java:228)

    at org.jvnet.mimepull.MIMEMessage.parseAll(MIMEMessage.java:189)

    at org.jvnet.mimepull.MIMEMessage.getAttachments(MIMEMessage.java:115)

    at org.glassfish.jersey.media.multipart.internal.MultiPartReaderClientSide.getMimeParts(MultiPartReaderClientSide.java:272)  

Can you please help me in resolving this issue

Nikhil,

Could you provide more information on the file and the request you were sending? Some screenshot of the case will also help.

Hi Trong,

Sorry for replying late below is the curl which I was trying through katalon:

curl -X POST \

‘http://’ \

-H ‘Cache-Control: no-cache’ \

-H 'tenant-id: ’ \

-H ‘user-id: UID’ \

-F ‘files=@D:\Katalon_Upload\2.PDF’ \

-F 'metadata={

“loanInfo”:{

“primaryBusinessKey”: “NikhilR505”,

“loanNumber”: “NikhilR505”,

“loanTypeId”: “30YEAR”,

“applicationDate”: “2018-04-28T00:00:00.000Z”,

“metaData”: {

“primaryFirstName”: “Nikhil”,

“primaryLastName”: “Indurkar”

}

}

}’

I used the object repository to configure this curl and was trying to send a pdf file

image.png

Im having the same problem. I must say it ABSOLUTELY SUCKS that katalon doen not show the outgoing request. This makes it extremely dificult to figure out what is wrong with the request.

Did u manage to get this to work?
thx

3 Likes

marco tulio zahn said:

that katalon doen not show the outgoing request.

Yeah. But im using for this fiddler as proxy. It really help in work.

Was there a resolution to this error?

request.getRestUrl() I use this method to print request URL.

Also created a Keyword to print header info. Hope it will help

@Keyword
def PrintHeader(RequestObject request) {

	List <TestObjectProperty> header=request.getHttpHeaderProperties()
	String headers="\n ::::Headers::: \n" + "Body Contents:  "+ request.bodyContent.text +"\n"
	int i=0
	while(i<request.getHttpHeaderProperties().size()) {
		headers= headers+header.get(i).name +":   " + header.get(i).getValue()+'\n'

		i++
	}
	return headers
}