Overview

Packages

  • Requests
    • Authentication
    • Cookies
    • Proxy
    • Session
    • Transport
    • Utilities

Classes

  • Requests_Auth_Basic

Interfaces

  • Requests_Auth
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Warning! You are currently reading the documentation for Requests 1.x.

It is recommended to upgrade to Requests 2.x at your earliest convenience. Upgrading to Requests 2.x is fairly straight-forward.
A full list of the changes can be found in the Changelog.

Visit the documentation for Requests_Auth_Basic in Requests 2.x.

Class Requests_Auth_Basic

Basic Authentication provider

Provides a handler for Basic HTTP authentication via the Authorization header.

Requests_Auth_Basic implements Requests_Auth
Package: Requests\Authentication
Located at Requests/Auth/Basic.php
Methods summary
public
# __construct( array|null $args = null )

Constructor

Constructor

Parameters

$args
Array of user and password. Must have exactly two elements

Throws

Requests_Exception
On incorrect number of arguments (authbasicbadargs)
public
# register( Requests_Hooks $hooks )

Register the necessary callbacks

Register the necessary callbacks

Parameters

$hooks
Hook system

See

Requests_Auth_Basic::curl_before_send()
Requests_Auth_Basic::fsockopen_header()

Implementation of

Requests_Auth::register()
public
# curl_before_send( resource & $handle )

Set cURL parameters before the data is sent

Set cURL parameters before the data is sent

Parameters

$handle
cURL resource
public
# fsockopen_header( string & $out )

Add extra headers to the request before sending

Add extra headers to the request before sending

Parameters

$out
HTTP header string
public string
# getAuthString( )

Get the authentication string (user:pass)

Get the authentication string (user:pass)

Returns

string
Properties summary
public string $user

Username

Username

#
public string $pass

Password

Password

#
Requests 1.8.1 API Documentation API documentation generated by ApiGen