From 990ec6abe28648c77ab241ab3aaef17721e6ec5b Mon Sep 17 00:00:00 2001 From: Khai Do Date: Thu, 10 Jul 2014 13:15:59 -0700 Subject: [PATCH] Add a PUT example to rest api documentation The exact REST command to do a PUT/POST was confusing me so adding a more concrete example to the documentation. I also noticed that other people had problems as well: https://groups.google.com/d/msg/repo-discuss/lLJg59RJ5g0/4-r3SQu118wJ Change-Id: Idd493b6a42eb3ef0a4f2001ca3449e90a71c493a --- Documentation/dev-rest-api.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/dev-rest-api.txt b/Documentation/dev-rest-api.txt index d07da622d2..ec4b66613a 100644 --- a/Documentation/dev-rest-api.txt +++ b/Documentation/dev-rest-api.txt @@ -44,6 +44,11 @@ option instead: curl -X PUT --data-binary @testdata.txt --header "Content-Type: text/plain" http://localhost:8080/path/to/api/ ---- +Example to set a Gerrit project's link:rest-api-projects.html#set-project-description[description]: + +---- + curl -X PUT --digest --user john:2LlAB3K9B0PF --data-binary @project-desc.txt --header "Content-Type: application/json;charset=UTF-8" http://localhost:8080/a/projects/myproject/description +---- === Authentication @@ -65,7 +70,6 @@ file (on Windows, `_netrc`): In both cases, the password should be the user's link:user-upload.html#http[HTTP password]. - === Verifying Header Content To verify the headers returned from a REST API call, use `curl` in verbose mode: