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

use /content instead of /download for downloading files #1

Open
cagdasgerede opened this issue Jun 3, 2017 · 0 comments
Open

use /content instead of /download for downloading files #1

cagdasgerede opened this issue Jun 3, 2017 · 0 comments

Comments

@cagdasgerede
Copy link
Member

Note that we could also use /content. Sometimes /download returns binary zip file; for instance:

curl https://android-review.googlesource.com/changes/8299/revisions/1/files/media%2Fjni%2Fandroid_media_AmrInputStream.cpp/download

This is not a problem always since for instance the following returns plain text:

curl https://gerrit.wikimedia.org/r/changes/356858/revisions/1/files/SpamBlacklistHooks.php/download

Not to be broken by the former cases, it would be better to download via /content. However, that returns base64 encoded content; therefore, we need to decode the response before saving it in a file for further processing.

An example on how to decode on the terminal is as follows:

curl https://android-review.googlesource.com/changes/8299/revisions/1/files/media%2Fjni%2Fandroid_media_AmrInputStream.cpp/content| base64 --decode

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

1 participant