I cannot find a way to send a HTTP POST-Request and saves the response in streaming mode to a file. For GET-Requests I use the "Download" function, but I need the same with a POST-Request.
The files that should be downloaded are not in the public space of the webserver. There is a script to deliver the file and this needs the parameters as a POST-Request. The files can be 500 MB and more, and so I cannot load it to the memory before saving it to disk.
Is there a way to do it?
The example below is better because it allows you to distinguish successful vs. failure responses. In other words, it allows the response header to first be retrieved, then examined, and then one can decide how to handle the response body. If it's a failed response header, you can treat the response body differently (because you wouldn't actually be downloading the file..)
(The example uses a URL that isn't actually a large file, but is just a simple quick HTML response.)