【问题标题】:airbnb mashape api not working in phpairbnb mashape api在php中不起作用
【发布时间】:2015-01-24 10:26:32
【问题描述】:
$(document).ready(function()
{

$("#btnTrigger").on('click',function(){ 

$.ajax({

      url:'https://airbnb.p.mashape.com/s', 
     type:'Get', 
    data:{location:$("boxArea").val()}, 
    datatype:'json', 
    success:function(data) {
     alert(JSON.stringify(data)); 
    $("#boxArea").val(JSON.stringify(data));
 },

    error:function(err)
   { 
 alert(err);  
}, 

      beforeSend:function(Xhr) { 

            Xhr.setRequestHeader("X-Mashape-Authorization","7MooPcOHR9mshGWoRGqd4h4UMv2Cp1kFLV3jsn3UDWi3yIxSot");
 } 
});
 });
 });

因为这在 js fiddle 上运行良好,但当我在 php 中运行时无法运行.....请帮助了解如何生成 airbnb.com 的 api 并在 php 中使用它

【问题讨论】:

    标签: php ajax json api curl


    【解决方案1】:

    您遇到了什么错误? 你能链接到AIRBNB的API吗? 我认为它不再存在,因此您为什么会出错

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-26
      • 1970-01-01
      • 2014-05-01
      • 1970-01-01
      • 2012-12-09
      • 2013-10-07
      相关资源
      最近更新 更多