aboutsummaryrefslogtreecommitdiff
path: root/docs/requests/authentication.rst
blob: 5c6005153290720fe5a13b862bc98f5f7803e781 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
.. _authentication:

Authentication
==============

sttp supports basic and bearer-token based authentication. In both cases, an ``Authorization`` header is added with the appropriate credentials.

Basic authentication, using which the username and password are encoded using Base64, can be added as follows::

  sttp.auth.basic(username, password)

A bearer token can be added using::

  sttp.auth.bearer(token)