unable to put csv to request

hi,

i’m newbie user for using katalon studio. i have a problem when i try to put some csv to the request. its doesnt works. some body please can help?

TestObjectProperty header1put = new TestObjectProperty(“x-oss-object-acl”, ConditionType.EQUALS, “private”)
TestObjectProperty header2put = new TestObjectProperty(“Content-Type”, ConditionType.EQUALS, “text/csv”)
ArrayList defaultHeadersput = Arrays.asList(header1put, header2put)

RequestObject ro3 = new RequestObject()
ro3.setRestUrl(presign_url)
ro3.setHttpHeaderProperties(defaultHeadersput)
ro3.setRestRequestMethod(“PUT”)
ro3.setBodyContent(new HttpFileBodyContent(“C:\Users\Sehati - Rudi\Documents\CCAutomation\24a92cf9-5581-43c0-8e0b-d2a5296bea2f-1561075966 (1).csv”))

Object res3 = WS.sendRequest(ro3)

================================

2019-12-13 23:17:47.391 DEBUG testcase.API - Create CTG - 46: res3 = sendRequest(ro3)
2019-12-13 23:17:47.409 ERROR c.k.k.core.keyword.internal.KeywordMain - :x: Unable to send request (Root cause: java.net.MalformedURLException
at com.kms.katalon.core.webservice.common.RestfulClient.sendRequest(RestfulClient.java:74)
at com.kms.katalon.core.webservice.common.RestfulClient.send(RestfulClient.java:59)

At first look, it seems presign_url is invalid. Where is it assigned? What does it contain?

Hi Thomas,

presign_url is a responsebody of another service called in above thats script. like

Object res2 = WS.sendRequest(ro2)
String w2 = res2.getResponseText()
def parsedJson2 = slurper.parseText(w2)
assert parsedJson2 instanceof Map
presign_url = parsedJson.data.url

the value of presign_url is like https://xxxxxxxx-staging.oss-ap-southeast-5.aliyuncs.com/xxx/xxx/xxxxxxxxxxxxxxxxxxx?Expires=xxxxxxxxxxx&OSSAccessKeyId=xxxxxx&Signature=xxxxxxxx%xxxx%xxxx%xx