Skip to content

Conversation

@fabre-thibaud
Copy link

Current Contents API requires to download the file (even with the "show" method, file content is returned up to 1Mb in size) just to check if it exists remotely.

Proposed changes adds a head(...) helper method to AbstractApi and leverages it to make a HEAD call to the "Get contents" endpoint of the API instead of a GET to avoid downloading file content.

Thibaud Fabre added 2 commits July 31, 2014 14:22
Using only HEAD method to avoid downloading file contents when the file does exist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nop

@Nek-
Copy link
Contributor

Nek- commented Jul 31, 2014

Thank you !

The idea is pretty :) . Can you add a part of doc for it ?

@fabre-thibaud
Copy link
Author

Erf, sorry, comes from my autoformat settings... Gonna fix that & add the doc

@fabre-thibaud
Copy link
Author

All right, doc is done for the Contents API (except the archive endpoint which I never user).

Let me know if there are changes to be made.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be 1 line above with } catch, same for others

@cursedcoder
Copy link
Contributor

@aztech-dev perfect!

cursedcoder added a commit that referenced this pull request Aug 1, 2014
Add ability to check that a file exists in repo branch/commit
@cursedcoder cursedcoder merged commit e66b635 into KnpLabs:master Aug 1, 2014
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

Successfully merging this pull request may close these issues.

4 participants