FlashGot passes with POST data the headers:
Code: Select all
Content-Type: application/x-www-form-urlencoded
Content-Length: <POST data length>
I can add logic in my downloader to skip the headers. But I was hoping for a cleaner solution.
Code: Select all
Content-Type: application/x-www-form-urlencoded
Content-Length: <POST data length>
To clarify, I added my still-unpublished downloader manually to FlashGot for testing. The POST placeholder provided by FlashGot included the headers when I tested a typical case using an HTML submit button. There are no third parties in action here.flashgot.user wrote:Of course there is a cleaner solution: file a bug against whatever thing (e.g. a Flash plugin) puts headers to POST data. FlashGot just grabs a channel's upload stream which is supposed to contain just the POST data without any headers.
Code: Select all
http://rghost.net/private/72gGHl5R4/552e8ef7b269a14e4936c72eed791505
Thank you.flashgot.user wrote:If it's Content-Type and Content-Length, and only these 2, then yes, they're injected by the browser, and FlashGot passes them untouched to you. But I guess that just breaks every downloader because no one expects POST data in such format. Besides, I forgot to modify flashgot.exe to account for that change, so it was broken anyway. So here we go, this version drops the headers again:Code: Select all
http://rghost.net/private/72gGHl5R4/552e8ef7b269a14e4936c72eed791505
Now that you mention it. A list of reference examples for different POST scenarios would be very useful.flashgot.user wrote:But you do realise that this approach is still broken? I mean, multipart POSTs won't work at all (without you (the downloader) parsing the POST data and adding the correct Content-Type header), and even for a url-encoded POST you may need the charset.
That was exactly my thinking, thank you.flashgot.user wrote:I just realised that I forgot to add a placeholder for extra headers. This is where those POST-related headers could also go.
Giorgio, what do you think?
Code: Select all
http://rghost.net/private/7S6fZJWgc/9d50750d9038f2dfeb03ce6af183c48b
None, AFAIK, hence we're golden as we are I guess.flashgot.user wrote:I have no idea which downloader from the default supported downloader list supports custom request headers and POST data format other than url-encoded
Code: Select all
-url [URL] [-post POST] [-rawpost RAWPOST] [-headers HEADERS]
Code: Select all
argc=7
[0]: len=49: 'C:\hiawatha-9.2.UNP\hiawatha-9.2\wwwroot\test.exe'
00000000: 43 3a 5c 68 69 61 77 61 74 68 61 2d 39 2e 32 2e C:\hiawatha-9.2.
00000010: 55 4e 50 5c 68 69 61 77 61 74 68 61 2d 39 2e 32 UNP\hiawatha-9.2
00000020: 5c 77 77 77 72 6f 6f 74 5c 74 65 73 74 2e 65 78 \wwwroot\test.ex
00000030: 65 e
[1]: len=4: '-url'
00000000: 2d 75 72 6c -url
[2]: len=25: 'http://localhost/test.php'
00000000: 68 74 74 70 3a 2f 2f 6c 6f 63 61 6c 68 6f 73 74 http://localhost
00000010: 2f 74 65 73 74 2e 70 68 70 /test.php
[3]: len=5: '-post'
00000000: 2d 70 6f 73 74 -post
[4]: len=3: 'a=b'
00000000: 61 3d 62 a=b
[5]: len=8: '-rawpost'
00000000: 2d 72 61 77 70 6f 73 74 -rawpost
[6]: len=73: 'Content-Type: application/x-www-form-urlencoded
Content-Length: 3
a=b'
00000000: 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 61 70 Content-Type: ap
00000010: 70 6c 69 63 61 74 69 6f 6e 2f 78 2d 77 77 77 2d plication/x-www-
00000020: 66 6f 72 6d 2d 75 72 6c 65 6e 63 6f 64 65 64 0d form-urlencoded.
00000030: 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68 3a .Content-Length:
00000040: 20 33 0d 0a 0d 0a 61 3d 62 3....a=b
Code: Select all
<form method="POST" action="test.php">
<input type="text" name="a" value="b" />
<input type="submit" />
</form>
Code: Select all
<?php
http_response_code(200);
header("Content-Type: audio/mpeg");
?>