Class BasicAuthentication

Basic authentication. Adds Authorization: Basic header to request

class BasicAuthentication
  : Auth ;

Constructors

NameDescription
this Constructor.

Fields

NameTypeDescription
_domains string[]
_password string
_username string

Methods

NameDescription
authHeaders create Basic Auth header
password return user password
userName returns username

Example

import requests;
void main() {
rq = Request();
rq.authenticator = new BasicAuthentication("user", "passwd");
rs = rq.get("http://httpbin.org/basic-auth/user/passwd");
}