Skip to content

Add Metadata-only support for supported endpoints/methods #3774

@cmgriffing

Description

@cmgriffing

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.

  1. 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.
  2. Create new methods. eg: RepositoryFiles.showMetadata and RepositoryFiles.showRawMetadata

Checklist

  • I have checked that this is not a duplicate issue.
  • I have read the documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureChanges add a new feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions