summaryrefslogtreecommitdiff
path: root/doc/api/repository_files.md
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2016-04-08 15:28:21 +0200
committerZeger-Jan van de Weg <zegerjan@gitlab.com>2016-04-13 14:22:45 +0200
commitf460fe71fe0948150469cb8751fc10636f6b9f4f (patch)
treea096132c49edb059d244de2b6b7d268e0cab3bca /doc/api/repository_files.md
parent01cda13909803ff6a02d9d489da517f55163967e (diff)
downloadgitlab-ce-f460fe71fe0948150469cb8751fc10636f6b9f4f.tar.gz
Diffstat (limited to 'doc/api/repository_files.md')
-rw-r--r--doc/api/repository_files.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/api/repository_files.md b/doc/api/repository_files.md
index 623063f357b..9962bf21c23 100644
--- a/doc/api/repository_files.md
+++ b/doc/api/repository_files.md
@@ -33,6 +33,30 @@ Parameters:
- `file_path` (required) - Full path to new file. Ex. lib/class.rb
- `ref` (required) - The name of branch, tag or commit
+## Get raw file from repository
+
+Allows you to receive a file from the repository without any metadata.
+
+```
+GET /projects/:id/repository/files/raw
+```
+
+| Attribute | Type | Required | Description |
+| --------- | ---- | -------- | ----------- |
+| `id` | integer | yes | The ID of a project |
+| `file_path` | string | yes | Full path to file. Ex. lib/class.rb |
+| `ref` | string | yes | The name of branch, tag or commit |
+
+```bash
+curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" --data "ref=master" --data "file_path=Gemfile" https://gitlab.example.com/api/v3/projects/5/repository/files/raw
+```
+
+Example response:
+
+```
+"source \"https://rubygems.org\"\n\ngem 'rails', '4.2.5.2'\ngem 'rails-deprecated_sanitizer', '~\u003e 1.0.3'\n\n# Responders respond_to and respond_with\ngem 'responders', '~\u003e 2.0'\n\n
+```
+
## Create new file in repository
```