doupi3874 2013-09-05 01:56
浏览 104
已采纳

API请求无效 - “无效的IP”

I'm working on a web app that talks to an API which authenticates requests by checking what IP they originated from. I've registered my test server with the API, but when I make a request, I get an XML response that says "Invalid IP."

To demonstrate the issue, I've made a bare-bones page which is just a button that when clicked makes a sample request and displays the response in the console: http://beta.pacificcoasttitle.com/test.html

I'm making the request using AJAX and a PHP proxy since its cross domain -- could this have something to do with the problem?

PHP proxy looks like this:

   <?php
   $file = file_get_contents($_GET['requrl']);
   echo $file;
   ?>
  • 写回答

1条回答 默认 最新

  • dongluo3962 2013-09-05 02:26
    关注

    I guess the access is not allowed for your server IP.

    However it is very easy to test that and be sure, just do:

    $url = 'http://rc.api.sitexdata.com/sitexapi/sitexapi.asmx/AddressSearch?Key=FFB6F23F-6FDA-4F16-A149-DB0834012C5F&Address=1432%20Dana%20Ave&LastLine=94301&ReportType=103&ClientReference=string&OwnerName=string';
    $file = file_get_contents($url);
    echo $file;
    

    My advice is that once you made it to work with pure PHP, then move to the ajax implementation. This way it is easier to debug anyway.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应