---
title: "Get file content"
method: GET
path: "/file/content"
tags: ["File"]
---

# Get file content

`GET /file/content`

Honors the `Accept` header. If the value of the header is `text/plain` and there is a document in the index that
has the genre detected as plain text, the contents of the document will be returned. If the document is not found,
HTTP error 404 will be returned. If the genre of the document is not plain text, HTTP error 406 will be returned.
Alternatively, use `application/octet-stream` to bypass the document and genre check. The `Content-Type` header of
the reply will be set accordingly.

## Query parameters

- `path` string, required

## Response `200`

File content.

## Other responses

- `404` — Document not found.
- `406` — Document genre is not plain text.

---

[API](https://skmtc.net/oracle/apis/opengrok-restful-api.md) · [All operations](https://skmtc.net/oracle/apis/opengrok-restful-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/oracle/opengrok-restful-api/revisions/4844bf710203/schema)
