This use-case is documented here:
But I don’t want to export my game to the web
You can upload files directly with
HTTPRequest but you’ll need to create the
http request payload by hand.
You can try this plugin Godot 4 - HTTPManager - Godot Asset Library which seems to do that for you and has support for uploading files.
Do you know how to upload the file using GDscript directly?