Merge changes from topic 'inline-3'

* changes:
  Add REST API to retrieve file's content type from revision
  InlineEdit: Add GET /changes/{id}/edit/{path}/type endpoint
This commit is contained in:
David Pursehouse
2014-12-10 07:16:26 +00:00
committed by Gerrit Code Review
6 changed files with 165 additions and 1 deletions

View File

@@ -1433,6 +1433,29 @@ specified file was deleted in the change edit "`204 No Content`" is returned.
RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
----
[[get-edit-file-mime-type]]
=== Retrieve file content MIME type from Change Edit
--
'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/type
--
Retrieves content MIME type of a file from a change edit.
.Request
----
GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo%2fbar%2fbaz%2fqux.txt/type HTTP/1.0
----
.Response
----
HTTP/1.1 200 OK
Content-Disposition: attachment
Content-Type: application/json;charset=UTF-8
)]}'
"text/plain"
----
[[get-edit-message]]
=== Retrieve commit message from Change Edit or current patch set of the change
--
@@ -2790,6 +2813,31 @@ The content is returned as base64 encoded string.
Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
----
[[get-content-type]]
=== Get Content MIME Type
--
'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/type'
--
Gets the content MIME type of a file from a certain revision.
.Request
----
GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/readme.txt/type HTTP/1.0
----
The content MIME type is returned as string.
.Response
----
HTTP/1.1 200 OK
Content-Disposition: attachment
Content-Type: application/json;charset=UTF-8
)]}'
"text/plain"
----
[[get-diff]]
=== Get Diff
--