grab icon indicating copy to clipboard operation
grab copied to clipboard

need callback for each internal requests

Open hbakhtiyor opened this issue 7 years ago • 3 comments

how many internally call http requests? if file exists one head request, is it only this call? or have another? i need to get header ("auth") of the head request and set new one on next request.

any apis to achieve this?

hbakhtiyor avatar Jan 07 '19 11:01 hbakhtiyor

This is currently not possible but something I should consider. Alternatively, you can perform the head request yourself first and then populate a grab request.

cavaliercoder avatar Jan 07 '19 17:01 cavaliercoder

how to disable internal additional head requests?

hbakhtiyor avatar Jan 08 '19 07:01 hbakhtiyor

You can disable grab's HEAD requests by setting Request.NoResume = true. Naturally, this will also prevent grab from being able to resume incomplete downloads.

If you want both features, you will need three request:

  • first you send a HEAD request to get the auth header
  • second, grab will send HEAD request to determine file size, resume-ability, etc.
  • last, grab will send GET request to download the file

If your program is not particularly latency sensitive, this additional HEAD request seem inexpensive to me.

cavaliercoder avatar Feb 28 '19 04:02 cavaliercoder