I'm building a small VS Code extension that takes the contents of the current editor tab in VS Code and posts it to a URL I specify somewhere (ideally in the VS Code UI via an input field).
What VS Code API would I use (or what other method) to make the REST API call - can I just use a regular Javascript fetch() or even JQuery?
Other issue is I need to authenticate access to the REST API I'm accessing, via regular user input on a web page, prior to POSTing (from JS etc) to the API - would that be possible (e.g. via a WebView in VSCode I guess) and then keep that authentication live to do the subsequent POSTs?
Thanks
Edit: Wondering if I can open a WebView to handle the initial web login and authentication by the user, then run some JS code inside the webview that gets the contents of the current editor tab and posts it to the REST API, would that be possible?