Description
The GitLab API has support for sending a HEAD request to get only metadata.
https://docs.gitlab.com/api/repository_files/#get-file-metadata-only
This is useful when you want to check for the existence of a file without having to download it.
Proposal
The first steps would be adding HEAD support to the RequestHelper class.
After that, the implementation for various endpoints would need to be done. eg: RepositoryFiles.show and RepositoryFiles.showRaw, maybe more.
There are 2 ways I can think of implementing this.
- Add a flag to the options for the respective functions such as
metadataOnly. This would make the type safety a bit trickier to do right.
- Create new methods. eg:
RepositoryFiles.showMetadata and RepositoryFiles.showRawMetadata
Checklist
Description
The GitLab API has support for sending a
HEADrequest to get only metadata.https://docs.gitlab.com/api/repository_files/#get-file-metadata-only
This is useful when you want to check for the existence of a file without having to download it.
Proposal
The first steps would be adding
HEADsupport to the RequestHelper class.After that, the implementation for various endpoints would need to be done. eg:
RepositoryFiles.showandRepositoryFiles.showRaw, maybe more.There are 2 ways I can think of implementing this.
metadataOnly. This would make the type safety a bit trickier to do right.RepositoryFiles.showMetadataandRepositoryFiles.showRawMetadataChecklist