diff options
author | Rémy Coutable <remy@rymai.me> | 2018-10-09 14:36:30 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-10-09 14:36:30 +0200 |
commit | 33304a8b46e0d062f789a049a08e5d33a00ddd15 (patch) | |
tree | 513152e5bed1c8cfbbe29f083e8d3b7a49307bfa | |
parent | 7a21f17de2b280fded64e7ce36f7ada208521234 (diff) | |
download | gitlab-ce-33304a8b46e0d062f789a049a08e5d33a00ddd15.tar.gz |
Improve the Repository files documentation
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r-- | doc/api/repository_files.md | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/doc/api/repository_files.md b/doc/api/repository_files.md index 0623a6b02ae..c3624f1a535 100644 --- a/doc/api/repository_files.md +++ b/doc/api/repository_files.md @@ -97,7 +97,10 @@ POST /projects/:id/repository/files/:file_path ``` ```bash -curl --request POST --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' 'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fprojectrb%2E?branch=master&author_email=author%40example.com&author_name=Firstname%20Lastname&content=some%20content&commit_message=create%20a%20new%20file' +curl --request POST --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' --header "Content-Type: application/json" \ + --data '{"branch": "master", "author_email": "author@example.com", "author_name": "Firstname Lastname", \ + "content": "some content", "commit_message": "create a new file"}' \ + 'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb' ``` Example response: @@ -129,7 +132,10 @@ PUT /projects/:id/repository/files/:file_path ``` ```bash -curl --request PUT --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' 'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb?branch=master&author_email=author%40example.com&author_name=Firstname%20Lastname&content=some%20other%20content&commit_message=update%20file' +curl --request PUT --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' --header "Content-Type: application/json" \ + --data '{"branch": "master", "author_email": "author@example.com", "author_name": "Firstname Lastname", \ + "content": "some content", "commit_message": "update file"}' \ + 'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb' ``` Example response: @@ -171,7 +177,10 @@ DELETE /projects/:id/repository/files/:file_path ``` ```bash -curl --request DELETE --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' 'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb?branch=master&author_email=author%40example.com&author_name=Firstname%20Lastname&commit_message=delete%20file' +curl --request DELETE --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' --header "Content-Type: application/json" \ + --data '{"branch": "master", "author_email": "author@example.com", "author_name": "Firstname Lastname", \ + "commit_message": "delete file"}' \ + 'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb' ``` Parameters: |