Note that there are some explanatory texts on larger screens.

plurals
  1. POConnect to local web service (running under MAMP) from iPhone via WIFI.
    text
    copied!<p>I have setup a local REST webservice with MAMP.</p> <p>I have setup a virtual host with the url "<a href="http://aem.davidcasillas" rel="nofollow noreferrer">http://aem.davidcasillas</a>" pointing to my public folder.</p> <p>MAMP is listening on port 80.</p> <p>If I access via Safari to "<a href="http://aem.davidcasillas/webservice/rest/getEventosToday" rel="nofollow noreferrer">http://aem.davidcasillas/webservice/rest/getEventosToday</a>" I get the correct json data.</p> <p>Now I'm trying to access this web service from my iPhone application. I run it from XCode into the device.</p> <p>The device is connected to my local network via WIFI, and the connection is working (I can load webpages in safari)</p> <p>I'm using RestKit to download the data and I'm trying to reach it with the same url I use in my Mac: "<a href="http://aem.davidcasillas.es/webservice/rest/getEventosToday" rel="nofollow noreferrer">http://aem.davidcasillas.es/webservice/rest/getEventosToday</a>".</p> <p>In the device I get the error:</p> <pre><code>NSURLErrorDomain -1003 Found no server for the specified host name. </code></pre> <p>How should I write my url so I can reach the web service from the iPhone?</p> <p>NOTE: I have read this post: <a href="https://stackoverflow.com/questions/4063119/test-local-websites-with-mamp-on-iphone">test local websites with mamp on iphone?</a> but none of this problems apply to my case. I have firewall disabled and my config.ini file shows the following listen line:</p> <pre><code>Listen 80 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload