It is possible to make HTTP requests with Basic.
Restrictions apply to the use of OpenOffice under Windows. Please see the documentation for more information.
You must first install the OAuth2OOo extension.
and here is an example of Basic code:
Code: Select all
Rem ***** BASIC *****
Sub Main
Rem First we need to create the UNO OAuth2Service
oauth2 = CreateUnoService("io.github.prrvchr.OAuth2OOo.OAuth2Service")
Rem To execute an HTTP request we first need a HTTP Request parameter
parameter = oauth2.getRequestParameter("httpbin")
Rem Default Requests method is GET but can be changed (ie: parameter.Method = "PUT")
parameter.Url = "https://httpbin.org/ip"
Rem Default authentication is OAuth2 but can be disabled with:
parameter.NoAuth = True
Rem To obtain the HTTP response we use the execute() method
Rem of the OAuth2Service service with the HTTP parameter as argument
response = oauth2.execute(parameter)
If response.Ok Then
Msgbox response.Text
End If
Rem When it's finished we have to close the HTTP response
response.close()
End Subparameter is defined in the idl file XRequestParameter.idl
response is defined in the idl file XRequestResponse.idl
Enjoy...