无法获取输出.返回代码206.缺少值
Not able to fetch output. Return code 206. Missing values.
请提供帮助。我使用ajax对远程服务器进行同步调用。错误与异步调用相同。
function create_vswitch(endpoint,data){
var response=send_recieve(endpoint,data);
console.log(response.params.id);
return response.params.id;
}
function configure_server_vswitch(endpoint,data){
var response=send_recieve(endpoint,data);
console.log(JSON.stringify(response));
function send_recieve(endpoint,data){
var url=http://10.77.94.243/830a341f-5249-4704-bd49-a732063a7dcb + endpoint
console.log(url);
var response="";
$.ajax({
url: url,
type: "POST",
dataType:"json",
data: data,
contentType:"application/json",
success:function(){console.log("success")},
error:function(){console.log("ERROR")},
async:false
}).then(function(response){
resp=response;
});
return resp
$("#create").click(function() {
var COMPUTE_VSWITCH_UUID=create_vswitch("/qvbn-switch-agent/compute.vswitch",{"name":"compute_vswitch_test102"});
console.log(COMPUTE_VSWITCH_UUID);
//var compute_server_uuid=
configure_server_vswitch("/qvbn-switch-agent/compute.server",{"configuration":{"tid":"compute.vswitch","id":COMPUTE_VSWITCH_UUID}});
});
我得到的控制台输出是:
http://10.77.94.243:8280/830a341f-5249-4704-bd49-a732063a7dcb/qvbn-switch-agent/compute.vswitch
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience.
Done
739d4940-b12d-4a6c-8ba6-fad7d30ce78f
739d4940-b12d-4a6c-8ba6-fad7d30ce78f
http://10.77.94.243:8280/830a341f-5249-4704-bd49-a732063a7dcb/qvbn-switch-agent/compute.server
Done
{"code":206,"cid":"qvbb","reason":"missing values for attributes configuration","params":null,"result":false,"error":true}
正如您所看到的最后一个o/t,它说的是"属性配置缺少值"。我无法理解此代码的问题所在。有人能告诉我这个代码出了什么问题吗。
尝试用data: JSON.stringify(data),
替换data: data,
。
相关文章:
- 为什么这个代码返回NaN
- 为什么这两段代码返回的值不同
- 为什么此代码返回未定义的4次而不是数组值
- php代码返回基于数组的值
- 代码返回上次刷新前的最新值,而不是插入的最新的值
- ajax 代码返回 ProgressEvent 对象而不是我的模板数据
- 此 Javascript 代码返回“Undefined”
- 为什么这个 JavaScript 地板数学代码返回 nan
- 使用我自己的服务器解析云代码返回“未经授权”
- PHP 代码返回其脚本,在 JQuery Ajax 中不起作用
- Kohana - 使用“.exec”正则表达式发布javascript代码返回内部错误
- Codecademy - 我的代码返回 true,但它说我错过了其他东西
- 如何将window.baseUrl从剃刀代码返回到我的外部.js文件中
- 谷歌分析代码返回'未定义函数“;错误
- 为什么此代码返回未定义
- 通过ajax和外接程序表将表行作为HTML代码返回
- 从PHP代码返回的JSON字符串填充下拉列表
- 为什么这个javascript代码返回undefined
- 为什么不't此代码返回完整的文档高度
- 为什么我的代码返回ReferenceError:茶是没有定义,当我选择茶