HttpClientand assigned it to a variable in our
getmethod of the
HttpClientto invoke a get request.
getmethod takes three arguments. The first one is the
urlwhich we want to call. In the example we are going to fetch a widget which contains some HTML. The second parameter is a
callbackfunction. It will be invoked when the API call was done. In the example below we pass in the
handleDatamethod of our plugin. The callback function then receives the
responseof the API call. We can now use this in our plugin to display the widget in the DOM, for example.
getmethod is the
contentTypewhich will be sent in the request header of the API call. It is optional and by default set to be