Gets the blob of a repository.
GET
/repos/{owner}/{repo}/git/blobs/{sha}
const url = 'https://gitea.example.com/api/v1/repos/example/example/git/blobs/example';const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://gitea.example.com/api/v1/repos/example/example/git/blobs/example \ --header 'Authorization: Basic <credentials>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”owner
required
string
Owner of the repo
repo
required
string
Name of the repo
sha
required
string
Sha of the commit
Responses
Section titled “Responses”GitBlobResponse
Media typeapplication/json
GitBlobResponse represents a git blob
object
content
The content of the git blob (may be base64 encoded)
string
encoding
The encoding used for the content (e.g., “base64”)
string
lfs_oid
The LFS object ID if this blob is stored in LFS
string
lfs_size
The size of the LFS object if this blob is stored in LFS
integer format: int64
sha
The SHA hash of the git blob
string
size
The size of the git blob in bytes
integer format: int64
url
The URL to access this git blob
string
Examplegenerated
{ "content": "example", "encoding": "example", "lfs_oid": "example", "lfs_size": 1, "sha": "example", "size": 1, "url": "example"}APIError is error format response
Media typeapplication/json
Headers
Section titled “Headers”message
string
url
string
APINotFound is a not found empty response
Media typeapplication/json