Yes, it is possible to make synchronous requests using the Google APIs Client Library for JavaScript. You can do this by setting the async parameter to false when making a request using the gapi.client.request method.
Here is an example of making a synchronous request to the Google Plus API to retrieve the current user's profile information:
gapi.client.request({'path': '/plus/v1/people/me','method': 'GET','async': false}).then(function(response) { // do something with the response});
Note that making synchronous requests can freeze the browser until the request is completed, so it is generally not recommended to use this technique unless absolutely necessary. It is generally better to use asynchronous requests and handle the response in the callback function.
Yes, it is possible to make synchronous requests using the Google APIs Client Library for JavaScript. You can do this by setting the async parameter to false when making a request using the gapi.client.request method.
Here is an example of making a synchronous request to the Google Plus API to retrieve the current user's profile information:
gapi.client.request({ 'path': '/plus/v1/people/me', 'method': 'GET', 'async': false }).then(function(response) { // do something with the response });
Note that making synchronous requests can freeze the browser until the request is completed, so it is generally not recommended to use this technique unless absolutely necessary. It is generally better to use asynchronous requests and handle the response in the callback function.