Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/EmptyTag/155.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
List 如何使用katalon工具和groovy脚本在web服务请求主体中附加字符串列表_List_Web Services_Groovy_Http Post_Katalon Studio - Fatal编程技术网

List 如何使用katalon工具和groovy脚本在web服务请求主体中附加字符串列表

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

**在使用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, ('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(请求)

欢迎!请澄清您的问题并提供更多细节,如调试日志。删除请求的主体应该是什么样子?你能给我们举个例子吗?