-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in file_get_contents #2
Comments
I recommend a tool to test the web services called Postman, with it you can know how to test the functions and determine if you are having any error in the handling of the functions, a problem on the server or a configuration problem of the web service |
Personally, I developed this file to handle the functions that I have enabled in my web service to call them from any php file where I am going to use them.
|
there is an example of your code https://github.com/llagerlof/MoodleRest/wiki/MoodleRest-examples |
@brunocs86 Hi Bruno. I tested your code here, making the necessary changes to my environment and it worked. Looks like you have a name resolution problem. This can be caused for some reasons. Please, do this tests: Try to wget the server.
Open the
a. If wget cannot find the host, b. If wget find your server, it could be doing some redirection. In this case try using the IP of your Moodle server instead the host name. In c. If everything fails, just to cover most scenarios, try to wget using the IP instead the hostname. Please, report the results here so we can find a solution for your case. |
thanks for your contribution, it was very enlightening |
I will try to carry out your guidelines, thank you very much for helping me. |
Due to inactivity, and because I am assuming that the author of this issue must have already solved it, I am closing this thread. |
I have performed a test according to the code below
`<?php
require_once "MoodleRest.php";
$parameters = array('userlist' => array(array('userid' => 13, 'courseid' => 2), array('userid' => 13, 'courseid' => 2)));
$json = (new MoodleRest())->setServerAddress("http://dev.moodle.local/webservice/rest/server.php")->setToken('f0bb33743851adc4c2475240787c07b0')->setReturnFormat(MoodleRest::RETURN_JSON)->request('core_user_get_course_user_profiles', $parameters);
echo $json;`
And I got the following error
Can you help me?
The text was updated successfully, but these errors were encountered: