好吧,我已经使用 Badboy 录制了一个脚本并将其导出到 Jmeter。该脚本包含一个发布请求,该请求启动一个具有名称的文件。
参数随请求发送
noCache=1404378079862
{"alf_destination":"workspace://SpacesStore/${UUID}","prop_cm_name":"File _2","prop_cm_title":"","prop_cm_description":""}
每次我运行测试计划时,我都会收到 POST 请求的 500 错误代码(内部服务器错误)响应,它看起来像这样
{
"status" :
{
"code" : 500,
"name" : "Internal Error",
"description" : "An error inside the HTTP server which prevented it from fulfilling the request."
},
所以我使用 chrome 开发人员工具来捕获请求,我发现当我尝试创建一个名称已经存在的文件时,服务器以 500 错误代码响应我还发现 jmeter 发送的请求是不同的比我用开发者工具听到的是 jmeter 发送的:
POST https://${ServerName}/share/proxy/alfresco/api/type/cm%3acontent/formprocessor
听到的是我被开发者工具捕获的那个:
POST https://${ServerName}/share/proxy/alfresco/api/type/cm%3acontent/formprocessor?noCache=1404586721426&{"alf_destination":"workspace://SpacesStore/${uuid}","prop_cm_name" :"file_2,"prop_cm_title":"","prop_cm_description":"","prop_cm_content":"Ramadan kareem","prop_mimetype":"text/plain","prop_app_editInline":"true"}
我更改了我要创建的文件的名称,但仍然得到相同的错误,我已经搜索了解决方案,但没有任何改变。我尝试在每次迭代后清除缓存和 cookie,但它也不起作用。
这是jmeter提出的完整要求
POST https://${server}/share/proxy/alfresco/api/type/cm%3acontent/formprocessor
POST 数据:noCache=1404586721426&%7B%22alf_destination%22%3A%22workspace%3A%2F%2FSpacesStore%2F${uuid}%22%2C%22prop_cm_name%22%3A%22file_2%2C%22prop_cm_title%22%3A%22 %22%2C%22prop_cm_description%22%3A%22%22%2C%22prop_cm_content%22%3A%22Ramadan+kareem%22%2C%22prop_mimetype%22%3A%22text%2Fplain%22%2C%22prop_app_editInline%22%3A %22真%22%7D=
Cookie 数据:$Version=0;JSESSIONID=6508CDFBEF16F2D601CF1E672EB00D62.worker2;$路径=/共享/;alf登录=1404810408;$路径=/共享;alfUsername3=jmeter01;$路径=/共享;NSC_NzTibsf_TTM=ffffffff09f01c8f45525d5f4f58455e445a4a42378b;$路径=/
请求标头: 连接:keep-alive Alfresco-CSRFToken:${COOKIE_Alfresco-CSRFToken} 内容类型:application/json;charset=UTF-8 内容长度:359 主机:myshare.kfshrc.edu.sa 用户代理:Apache -HttpClient/4.2.6 (java 1.5)
谁能解释我为什么会收到这个错误?