From f4c9b82636b7a843a4957eab4ba5d6e5a8b402ee Mon Sep 17 00:00:00 2001 From: Brad Pitcher Date: Mon, 7 Jul 2014 14:33:56 -0700 Subject: [PATCH] add basic authentication code to usage sample code This information can be found in the documentation, but I think it's a common enough use case that it should be part of the basic usage code in the README. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 6ec4225..127af44 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,9 @@ import drest # Create a generic client api object api = drest.API('http://localhost:8000/api/v1/') +# Authenticate (Basic or Digest) +api.request.set_auth_credentials('your_username', 'your_password') + # Make calls openly via any HTTP Method, and any path # GET http://localhost:8000/api/v1/users/1/ response = api.make_request('GET', '/users/1/')