0

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;
   ?>
4

1 回答 1

1

我猜您的服务器IP不允许访问。

但是,很容易测试并确保,只需执行以下操作:

$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;

我的建议是,一旦你让它使用纯 PHP,然后转向 ajax 实现。这种方式无论如何都更容易调试。

于 2013-09-05T02:26:44.467 回答