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.
Thanks for your response.
Yes it's working after I changed $CFG->wwwroot to ip address. Thank you.