使用ajax,jqurey和get响应将数据放在REST API上 [英] Put data on REST api using ajax,jqurey and get response

查看:105
本文介绍了使用ajax,jqurey和get响应将数据放在REST API上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将数据放在我的休息api上作为

! - >



$ .ajax({

url:'http://cloudrtLoginCredentials',

类型:'put',

contentType: application / json; charset = utf-8,

dataType:'json',

crossDomain:true,

async:true,

数据:LoginCredentials,
成功:函数(dataFromServer){

alert(alertSuccess);

} ,

错误:函数(dataFromServer){

alert(dataFromServer +alertfailure);

}

});





但是

使用这种方法我无法调用我的休息api在另一台服务器上。

PLease帮我解决任何问题其他方法或api可用jqurey,ajax。

I am trying to put data on my rest api as
!-->

$.ajax({
url: 'http://cloud........LoginCredentials ',
type: 'Put',
contentType: "application/json; charset=utf-8",
dataType: 'json',
crossDomain: true,
async:true,
data: LoginCredentials,
success: function (dataFromServer) {
alert("alertSuccess");
},
error: function (dataFromServer) {
alert(dataFromServer + "alertfailure");
}
});


but
using this method i am not able to call my rest api that is on another server.
PLease help me out for any other methods or api available using jqurey,ajax.

推荐答案

.ajax({

url:'http:// cloud ... ..... LoginCredentials',

类型:'put',

contentType:application / json; charset = utf-8,

dataType:'json',

crossDomain:true,

async:true,

数据:LoginCredentials,
成功:函数(dataFromServer){

alert(alertSuccess);

},

错误:function(dataFromServer){

alert(dataFromServer +alertfailure);

}

});





但是

使用这种方法我无法调用另一台服务器上的其他api。

PLease帮助我使用jqurey,ajax提供任何其他方法或api。
.ajax({
url: 'http://cloud........LoginCredentials ',
type: 'Put',
contentType: "application/json; charset=utf-8",
dataType: 'json',
crossDomain: true,
async:true,
data: LoginCredentials,
success: function (dataFromServer) {
alert("alertSuccess");
},
error: function (dataFromServer) {
alert(dataFromServer + "alertfailure");
}
});


but
using this method i am not able to call my rest api that is on another server.
PLease help me out for any other methods or api available using jqurey,ajax.


这篇关于使用ajax,jqurey和get响应将数据放在REST API上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆