HTTP_OAuth
[ class tree: HTTP_OAuth ] [ index: HTTP_OAuth ] [ all elements ]

Class: HTTP_OAuth_Consumer_Request

Source Location: /HTTP_OAuth-0.3.1/HTTP/OAuth/Consumer/Request.php

Class Overview

HTTP_OAuth
   |
   --HTTP_OAuth_Message
      |
      --HTTP_OAuth_Consumer_Request

HTTP_OAuth_Consumer_Request


Author(s):

Copyright:

  • 2009 Jeff Hodsdon <jeffhodsdon@gmail.com>

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 45]
HTTP_OAuth_Consumer_Request

Class to make OAuth requests to a provider. Given a url, consumer secret, token secret, and HTTP method make and sign a request to send.



[ Top ]


Class Variables

$authType =  self::AUTH_HEADER

[line 60]

Auth type
  • Var: Authorization type
  • Access: protected

Type:   int


[ Top ]

$request =  null

[line 77]

HTTP_Request2 instance
  • Var: Instance of HTTP_Request2
  • Access: protected

Type:   HTTP_Request2


[ Top ]

$secrets = array('', '')

[line 70]

Secrets

Consumer and token secrets that will be used to sign the request

  • Var: Array of consumer and token secret
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 89]

void __construct( [string $url = null], [array $secrets = array()])

Construct

Sets url, secrets, and http method

  • Access: public

Parameters:

string   $url   —  Url to be requested
array   $secrets   —  Array of consumer and token secret

[ Top ]

accept   [line 108]

void accept( mixed $object)

Accept

Parameters:

mixed   $object   —  Object to accept

[ Top ]

buildRequest   [line 251]

HttpRequest buildRequest( )

Builds request for sending

Adds timestamp, nonce, signs, and creates the HttpRequest object.

  • Return: Instance of the request object ready to send()
  • Access: protected

[ Top ]

getAuthForHeader   [line 327]

void getAuthForHeader( array $params)

Creates OAuth header

Given the passed in OAuth parameters, put them together in a formated string for a Authorization header.

  • Access: protected

Parameters:

array   $params   —  OAuth parameters

[ Top ]

getAuthType   [line 195]

int getAuthType( )

Gets authentication type
  • Return: Set auth type
  • Access: public

[ Top ]

getHTTPRequest2   [line 134]

HTTP_Request2 getHTTPRequest2( )

Returns $this->request if it is an instance of HTTP_Request. If not, it creates one.
  • Access: protected

[ Top ]

getSecrets   [line 163]

array getSecrets( )

Gets secrets
  • Return: Secrets array
  • Access: public

[ Top ]

send   [line 209]

HTTP_OAuth_Consumer_Response send( )

Sends request

Builds and sends the request. This will sign the request with the given secrets at self::$secrets.

  • Return: Response instance
  • Throws: HTTP_OAuth_Exception when request fails
  • Access: public

[ Top ]

setAuthType   [line 178]

void setAuthType( int $type)

Sets authentication type

Valid auth types are self::AUTH_HEADER, self::AUTH_POST, and self::AUTH_GET

  • Access: public

Parameters:

int   $type   —  Auth type defined by this class constants

[ Top ]

setSecrets   [line 149]

void setSecrets( [array $secrets = array()])

Sets consumer/token secrets array
  • Access: public

Parameters:

array   $secrets   —  Array of secrets to set

[ Top ]

__call   [line 352]

mixed __call( string $method, array $args)

Call

If method exists on HTTP_Request2 pass to that, otherwise throw BadMethodCallException

  • Return: Result from method
  • Throws: BadMethodCallException When method does not exist on HTTP_Request2
  • Access: public

Parameters:

string   $method   —  Name of the method
array   $args   —  Arguments for the method

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:55:06 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.