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
This commit is contained in:
Khai Do 2014-07-10 13:15:59 -07:00
parent 00039b3903
commit 990ec6abe2

View File

@ -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: