Byron / google-apis-rs

A binding and CLI generator for all Google APIs
http://byron.github.io/google-apis-rs
Other
1.02k stars 136 forks source link

reading a subrange of an object in google_storage1 #245

Closed yasushi-saito closed 3 years ago

yasushi-saito commented 4 years ago

How do I read a part of a large file using google_storage1? It looks like the only way is to add a "Range: from-to" HTTP header, but I can't find a way to do that in code generated using google-apis-rs. Can we somehow allow setting an arbitrary header in an HTTP request?

Byron commented 4 years ago

Indeed, as of now there is no way to add custom headers unless you want to adjust code in your own local copy. The delegate supports a pre_request() call, but unfortunately doesn't get to see the hyper request. That would need changing.

There is a new version of google-apis incubating right now, but I have the feeling they don't support that either. It might be worth placing an issue there as well to have a chance getting that incorporated from the very beginning.

Byron commented 3 years ago

Maybe you could try with the latest version of the crates now available with async support in v2.0 or the next generation of API generators.

As this repository is now in maintenance mode, this issue is probably not going to be fixed unless it is contributed.