One way to send a POST request with 'bundled' components is through PowerShell. Without knowing how you would normally send it, I can only really give a general description.
Basically, use the .NET WebClient
class.
$wc = New-Object System.Net.WebClient;
$wc.UploadString($url, "POST", $data);
To send the contents of a text file, read it into a variable:
$data = [System.IO.File]::ReadAllText($filename);
If you want to mimic submitting a web form, you need the following:
$wc.Headers.Add("Content-type", "application/x-www-form-urlencoded");
That normally requires key-value pairs:
$data = "uploadeddata=" + [System.IO.File]::ReadAllText($filename);
This might also help:
wc.Encoding = System.Text.Encoding.UTF8;
Example with Pastebin API:
$url = "http://pastebin.com/api/api_post.php";
$filename = "test.txt";
$api_dev_key = "a Pastebin API dev key should go here";
$api_option = "paste";
$api_paste_code = [System.Uri]::EscapeDataString([System.IO.File]::ReadAllText($filename));
$data = "api_dev_key=" + $api_dev_key + "&api_option=" + $api_option + "&api_paste_code=" + $api_paste_code;
$wc = New-Object System.Net.WebClient;
$wc.Headers.Add("Content-type", "application/x-www-form-urlencoded");
$wc.UploadString($url, "POST", $data);
All this is actually based on a C# program I was writing, so there may be a shorter way. There's no real need for 'one-liners', usually.
And before anyone suggests using Get-Content
for reading the text file, Get-Content
returns an array with one string per line. The POST data would be harder to build from that.