A better approach is to use WCMUsePojo with HTL to make a Restful call to a 3rd party service - as explained here: Creating an Adobe Experience Manager 6.4 HTL Component that displays data from a Restful Web Service
If you requirement is to make a call on the client - then you can use react to make a rest call. This could be done in script file located in a client lib. See this thread for more information -- json - Making REST calls from a react component - Stack Overflow
Having said that - if the requirement is to make a call to a Restful web service - like a Google service - and display the result set in a component -- its better to make the call on the server using Java/WCMUsePojo - as shown in the above article.