List 如何使用katalon工具和groovy脚本在web服务请求主体中附加字符串列表
**在使用groovy脚本传递字符串列表并将其附加到katalon中的删除请求主体中时,我面临着一个问题***List 如何使用katalon工具和groovy脚本在web服务请求主体中附加字符串列表,list,web-services,groovy,http-post,katalon-studio,List,Web Services,Groovy,Http Post,Katalon Studio,**在使用groovy脚本传递字符串列表并将其附加到katalon中的删除请求主体中时,我面临着一个问题*** def request = ((findTestObject('API/phone_numbers/phone_numbers.delete_from_database',[('base_url') : base_url,('account_id') : account_id, ('auth_token') : GlobalVariable.auth_token
def request = ((findTestObject('API/phone_numbers/phone_numbers.delete_from_database',[('base_url') : base_url,('account_id') : account_id,
('auth_token') : GlobalVariable.auth_token, ('credentials') : GlobalVariable.credentials])) as RequestObject)
List<String> list_Of_Numbers= {}
for (i in numbers)
{
list_Of_Numbers[i] = i
}
String body = """{"data":{"name":"'$list_Of_Numbers'"}}"""
request.setBodyContent(new HttpTextBodyContent(body))
def request=((findTestObject('API/phone\u number/phone\u number.delete\u from\u database'),[('base\u url'):base\u url,('account\u id'):account\u id,
('auth_token'):GlobalVariable.auth_token,('credentials'):GlobalVariable.credentials])作为请求对象)
列表\u编号的列表={}
用于(i个数字)
{
编号列表[i]=i
}
字符串正文=“{”数据:“{”名称:“$list\u Of_Numbers''}}”
request.setBodyContent(新的HttpTextBodyContent(body))
def response=WS.sendRequest(请求)欢迎!请澄清您的问题并提供更多细节,如调试日志。删除请求的主体应该是什么样子?你能给我们举个例子吗?