Use IP address to access Moodle API

Use IP address to access Moodle API

Lucy Hong གིས-
Number of replies: 2
I'm trying to get data via webservice API in my test ios app but I couldn't connect moodle API.
After spending long hours to find out why I've found that I need to use IP address to connect localhost API in my app. 
(https://stackoverflow.com/questions/51889837/cannot-connect-to-localhost-api-from-android-app)
But when I connect with IP address instead of the domain name, webservice functions are not working, it just redirects to the main page no matter what I call.

For example,


This should return login url but it returns the main page html tags. 
Anyone knows how to connect it via IP address or should I change the domain name as its local IP address?

Thank you for your help.
དཔྱ་སྙོམས་ཀྱི་སྐུགས་ཚུ།: -
In reply to Lucy Hong

Re: Use IP address to access Moodle API

Howard Miller གིས-
Core developers གི་པར Documentation writers གི་པར Particularly helpful Moodlers གི་པར Peer reviewers གི་པར Plugin developers གི་པར
What's stopping you using the URL in $CFG->wwwroot? You *have* to use that.