I’m a bit new to web services. I followed this tutorial and built a web service: http://davidwalsh.name/web-service-php-mysql-xml-json.
However, when I try to call to the web service using some parameters, e.g.
http://example.com/web-service.php?user=2&num=10
it is going to that page and shows the result. What I need is to get results without going to the site. I know this is possible by using Ajax, but I need to know is there any other way we can accomplish this? As the headers are using
header('Content-type: application/json');
can’t we get data without going to the web service page?
By “going to the webservice page” I assume you mean in your browser? @bardiir points out that you can use any http client to get this data.
In PHP, you could simply do a
and you would have the web service information as an array that you could parse and act upon.
If you can clarify further what it is you want to accomplish, I could help out more.