我不熟悉Spring RestTemplate.
但对于这个项目,我必须使用Spring RestTemplate发送POST调用以使用rest api.
我正在使用此代码:
String restCall = restTemplate.postForObject(url+restParm, null, String.class);
Run Code Online (Sandbox Code Playgroud)
这工作正常.
我想要恢复HTTP状态代码(例如:200 OK.).我怎么能这样做?谢谢.
我认为一切都在标题中.当我开始这个时,我认为这将是一个5分钟的代码或谷歌搜索时的快速结果...但现在是三个小时我在这:
只需显示一个对话框,其中包含"Please Wait ..."消息,而我正在执行ajax调用以检索一些json结果,然后显示"结果完成".
$('#switchOff').live("click",function(){
$('#dialog').dialog({
modal:true,
open: function(){
// I would like to call myAjax function
//From here ?
// While my dialog is showing the Wait message...
},
complete: function(){
//close the dialog when fished
$('#dialog').dialog('close');
},
});
});
function ajaxCall() {
//my ajax call
}
Run Code Online (Sandbox Code Playgroud)