Skip to content

[FEAT]: Add Overload to RepositoryContentsClient.GetRawContent Supporting Callback for Full Response #3022

@ravi-darshankar

Description

@ravi-darshankar

Describe the need

We propose adding an overload to RepositoryContentsClient.cs -> GetRawContent that accepts a callback function, enabling access to the full HTTP response object. This would allow consumers to extract metadata such as the Last-Modified header directly, without requiring a second API call.

Problem Statement:
Our application fetches markdown content from over 200+ remote repositories. In addition to the file content, we need to determine the latest commit that modified each file. Currently, this requires two separate API calls:

  1. GetRawContent – to fetch the file content

  2. RepositoryCommitsClient.cs -> GetAll – to retrieve the commit history for the file

This dual-call approach negatively impacts performance at scale. Providing access to the full response object from GetRawContent would allow us to extract relevant metadata (e.g., Last-Modified), potentially eliminating the need for the second call in many scenarios.

SDK Version

No response

API Version

No response

Relevant log output

Performance issue

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: FeatureNew feature or request

    Type

    No type

    Projects

    Status

    🆕 Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions