Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need callback for each internal requests #54

Open
hbakhtiyor opened this issue Jan 7, 2019 · 3 comments
Open

need callback for each internal requests #54

hbakhtiyor opened this issue Jan 7, 2019 · 3 comments

Comments

@hbakhtiyor
Copy link

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?

@cavaliercoder
Copy link
Collaborator

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.

@hbakhtiyor
Copy link
Author

how to disable internal additional head requests?

@cavaliercoder
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants