Archived Forum Post

Index of archived forum posts

Question:

HTTP Download of large file with POST-Request

Sep 23 '16 at 18:06

Hi,

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?

Thanks


Accepted Answer

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.)

Android: HTTP POST and Stream Response to File

Classic ASP: HTTP POST and Stream Response to File

C: HTTP POST and Stream Response to File

C++: HTTP POST and Stream Response to File

C#: HTTP POST and Stream Response to File

C# UWP/WinRT: HTTP POST and Stream Response to File

DataFlex: HTTP POST and Stream Response to File

Delphi ActiveX: HTTP POST and Stream Response to File

Delphi DLL: HTTP POST and Stream Response to File

.NET Core C#: HTTP POST and Stream Response to File

Excel: HTTP POST and Stream Response to File

Visual FoxPro: HTTP POST and Stream Response to File

Java: HTTP POST and Stream Response to File

Lianja: HTTP POST and Stream Response to File

MFC: HTTP POST and Stream Response to File

Mono C#: HTTP POST and Stream Response to File

Node.js: HTTP POST and Stream Response to File

Objective-C: HTTP POST and Stream Response to File

Perl: HTTP POST and Stream Response to File

PHP ActiveX: HTTP POST and Stream Response to File

PHP Extension: HTTP POST and Stream Response to File

PowerBuilder: HTTP POST and Stream Response to File

PowerShell: HTTP POST and Stream Response to File

PureBasic: HTTP POST and Stream Response to File

Python: HTTP POST and Stream Response to File

Ruby: HTTP POST and Stream Response to File

SQL Server: HTTP POST and Stream Response to File

Swift: HTTP POST and Stream Response to File

Tcl: HTTP POST and Stream Response to File

Unicode C: HTTP POST and Stream Response to File

Unicode C++: HTTP POST and Stream Response to File

Visual Basic 6.0: HTTP POST and Stream Response to File

VB.NET: HTTP POST and Stream Response to File

VB.NET UWP/WinRT: HTTP POST and Stream Response to File

VBScript: HTTP POST and Stream Response to File

Xojo Plugin: HTTP POST and Stream Response to File