To the last question:
https://www.example-code.com/foxpro/default.asp
Also, Bill Anderson maintains a library to make easier use of Chilkat libraries in VFP. I personally think Chilkat provides everything you need, but it may be helpful anyway, to know Bill Andersons GitHub repository for ChilkatVFP:
https://github.com/billand88/ChilkatVFP
But then, Scotts example is already making things clear. First things first:
1. For OAuth2 you need to get a token from the site to use in all your following requests
2. Then you provide that token in an authorization header, Scotts essential line covering oAuth2 for all requests after initially getting a token is that:
Code:
oHTTP.SetRequestHeader("Authorization", "Bearer " + lcToken)
No matter if you use WinHttp.WinHttpRequest.5.1, Msxml2.ServerXMLHTTP.6.0,, Chilkats or any other http rerquest class, the method names may vary slightly, but you set a http request header.
For base64, VFP has STRCONV(). that's a completely separate conversion issue.
Well, and once more first things first: The inital things you need to get the token are Azure "credentials" you can find or set up in your Azure account. A client ID, API key, clent secret, whatever. You have to fill the gaps in Scotts sample code, of course. If your .NET assembly has this all encapsulated and you have no hands on your (companies) Azure account, you can't recode that in VFP and better make use of that assembly. Nobody here and no library from a third party will know your Azure credntial API keys and secrects, of course.
And then, there's still enough more to implement with JSON or XML parsing, deserialization, processing in general, for which you'll find libraries on GitHub or from West Wind or Chilkat, too.