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 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?