From bfcd1652dbe4daa5a102d73eab55d551c8a4c0c0 Mon Sep 17 00:00:00 2001 From: Michele Tartara <mtartara@google.com> Date: Fri, 12 Apr 2013 08:47:06 +0000 Subject: [PATCH] Improve RAPI documentation for command line usage Provide some more insights about how to use the RAPI from the command line through the "curl" command. Signed-off-by: Michele Tartara <mtartara@google.com> Reviewed-by: Guido Trotter <ultrotter@google.com> --- doc/rapi.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/rapi.rst b/doc/rapi.rst index 259c96085..37dbebde6 100644 --- a/doc/rapi.rst +++ b/doc/rapi.rst @@ -75,7 +75,8 @@ When using the RAPI, username and password can be sent to the server by using the standard HTTP basic access authentication. This means that for accessing the protected URL ``https://cluster.example.com/resource``, the address ``https://username:password@cluster.example.com/resource`` should -be used instead. +be used instead. Alternatively, the appropriate parameter of your HTTP client +(such as ``-u`` for ``curl``) can be used. .. [#pwhash] Using the MD5 hash of username, realm and password is described in :rfc:`2617` ("HTTP Authentication"), sections 3.2.2.2 @@ -279,7 +280,10 @@ or ``curl``:: $ curl https://%CLUSTERNAME%:5080/2/info Note: with ``curl``, the request method (GET, POST, PUT) can be specified -using the ``-X`` command line option. +using the ``-X`` command line option, and the username/password can be +specified with the ``-u`` option. In case of POST requests with a body, the +Content-Type can be set to JSON (as per the Protocol_ section) using the +parameter ``-H "Content-Type: application/json"``. Python ++++++ -- GitLab