[WS] Send Request


This is a companion discussion topic for the original entry at https://docs.katalon.com/katalon-studio/docs/ws-send-request.html

should the response of WS.sendRequest and the variable “response” should have any compatibility ?
pls help me

my script is this -

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.util.KeywordUtil as KeywordUtil
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import groovy.json.JsonSlurper
def response = WS.sendRequest(findTestObject(‘New Request’))
KeywordUtil.logInfo(response)

and the error is

pls help me,i am in great need

thanks in advance

Hi there, The below should work …

KeywordUtil.logInfo(response.toString())

1 Like

response object is of ResponseObject type.
you have to use getResponseText() or getResponseBodyContent() methods to actually log the content.

see: https://api-docs.katalon.com/studio/v4.6.0.2/api/com/kms/katalon/core/testobject/ResponseObject.html

What if my url is dynamic how to check in such cases