Packagecom.yahoo.oauth
Classpublic class OAuthRequest

The OAuthRequest is used to create a request and apply a signature.

See also

http://oauth.net/core/1.0


Public Properties
 PropertyDefined by
  consumer : OAuthConsumer
The OAuth consumer.
OAuthRequest
  httpMethod : String
The HTTP request method used to send the request.
OAuthRequest
  requestParams : Object
An object containing key=value pairs used in the request and signing.
OAuthRequest
  requestURL : String
The URL of the resource.
OAuthRequest
  token : OAuthToken
The OAuth access token.
OAuthRequest
  useExplicitEncoding : Boolean = true
Determines if the request parameters in the signature base string should be encoded using encodeURIComponent.
OAuthRequest
  validRequestTypes : Array
[read-only] An array of the valid request types used to build and sign a request.
OAuthRequest
Public Methods
 MethodDefined by
  
OAuthRequest(httpMethod:String, requestURL:String, requestParams:Object = null, consumer:OAuthConsumer = null, token:OAuthToken = null)
Class constructor.
OAuthRequest
  
buildRequest(signatureMethod:IOAuthSignatureMethod, requestType:String, realm:String = null):*
Builds and signs the request using the provided signature method and result type requested.
OAuthRequest
  
Returns all non-OAuth parameters.
OAuthRequest
  
getOAuthParams():Object
Returns all OAuth parameters.
OAuthRequest
  
Builds a signable request string containing the http method, url and parameters.
OAuthRequest
Public Constants
 ConstantDefined by
  OAUTH_REQUEST_TYPE_HEADER : String = "OAUTH_REQUEST_TYPE_HEADER"
[static] A string which is used in buildRequest that the returned data type should be an URLRequestHeader type, containing an OAuth Authorization header.
OAuthRequest
  OAUTH_REQUEST_TYPE_OBJECT : String = "OAUTH_REQUEST_TYPE_OBJECT"
[static] A string which is used in buildRequest that the returned data type should be an Object.
OAuthRequest
  OAUTH_REQUEST_TYPE_POST : String = "OAUTH_REQUEST_TYPE_POST"
[static] A string which is used in buildRequest that the returned data type should be a string, usable as POST data.
OAuthRequest
  OAUTH_REQUEST_TYPE_URL_STRING : String = "OAUTH_REQUEST_TYPE_URL_STRING"
[static] A string which is used in buildRequest that the returned data type should be a url encoded string.
OAuthRequest
  OAUTH_REQUEST_TYPE_URL_VARIABLES : String = "OAUTH_REQUEST_TYPE_URL_VARIABLES"
[static] A string which is used in buildRequest that the returned data type should be an URLVariables object.
OAuthRequest
Property detail
consumerproperty
consumer:OAuthConsumer  [read-write]

The OAuth consumer.

Implementation
    public function get consumer():OAuthConsumer
    public function set consumer(value:OAuthConsumer):void

See also

httpMethodproperty 
httpMethod:String  [read-write]

The HTTP request method used to send the request. Value MUST be a member of URLRequestMethod

Implementation
    public function get httpMethod():String
    public function set httpMethod(value:String):void

See also

flash.net.URLRequestMethod
requestParamsproperty 
requestParams:Object  [read-write]

An object containing key=value pairs used in the request and signing. OAuth Protocol Parameter names and values are case sensitive. Each OAuth Protocol Parameters must not appear more than once per request, are required unless otherwise noted.

Implementation
    public function get requestParams():Object
    public function set requestParams(value:Object):void

See also

requestURLproperty 
requestURL:String  [read-write]

The URL of the resource. The request URL MUST include scheme, authority, and path and must exclude the query string in favor of the requestParams object.

Implementation
    public function get requestURL():String
    public function set requestURL(value:String):void

See also

tokenproperty 
token:OAuthToken  [read-write]

The OAuth access token.

Implementation
    public function get token():OAuthToken
    public function set token(value:OAuthToken):void

See also

useExplicitEncodingproperty 
public var useExplicitEncoding:Boolean = true

Determines if the request parameters in the signature base string should be encoded using encodeURIComponent.

validRequestTypesproperty 
validRequestTypes:Array  [read-only]

An array of the valid request types used to build and sign a request.

Implementation
    public function get validRequestTypes():Array
Constructor detail
OAuthRequest()constructor
public function OAuthRequest(httpMethod:String, requestURL:String, requestParams:Object = null, consumer:OAuthConsumer = null, token:OAuthToken = null)

Class constructor. Creates a new OAuthRequest object.

Parameters
httpMethod:String — The HTTP request method used to send the request. The value MUST be a member of URLRequestMethod
 
requestURL:String — The URL of the request, it must include the protocol, host, port (optional) and path.
 
requestParams:Object (default = null) — An optional object containing the key=value pairs to be used in the request.
 
consumer:OAuthConsumer (default = null) — An optional OAuthConsumer object used to sign the request.
 
token:OAuthToken (default = null) — An optional OAuthToken object used to sign the request.

See also

flash.net.URLRequestMethod
OAuthConsumer
OAuthToken
Method detail
buildRequest()method
public function buildRequest(signatureMethod:IOAuthSignatureMethod, requestType:String, realm:String = null):*

Builds and signs the request using the provided signature method and result type requested.

Parameters
signatureMethod:IOAuthSignatureMethod — An object implemented with IOAuthSignature method. Typically OAuthSignatureMethod_PLAINTEXT or OAuthSignatureMethod_HMAC_SHA1.
 
requestType:String — A request type that determines what OAuth signature is returned.
 
realm:String (default = null) — A string which specifies a realm which will be used in the request header. Used only if the requestType equals OAUTH_REQUEST_TYPE_HEADER.

Returns
* — An object whose type is determined by the requestType.

Throws
— Throws an Error if the signature method or request type is invalid and the request cannot be signed.

See also

getNonOAuthParams()method 
public function getNonOAuthParams():Object

Returns all non-OAuth parameters.

Returns
Object
getOAuthParams()method 
public function getOAuthParams():Object

Returns all OAuth parameters.

Returns
Object
getSignableString()method 
public function getSignableString():String

Builds a signable request string containing the http method, url and parameters.

Returns
String
Constant detail
OAUTH_REQUEST_TYPE_HEADERconstant
public static const OAUTH_REQUEST_TYPE_HEADER:String = "OAUTH_REQUEST_TYPE_HEADER"

A string which is used in buildRequest that the returned data type should be an URLRequestHeader type, containing an OAuth Authorization header.

See also

OAUTH_REQUEST_TYPE_OBJECTconstant 
public static const OAUTH_REQUEST_TYPE_OBJECT:String = "OAUTH_REQUEST_TYPE_OBJECT"

A string which is used in buildRequest that the returned data type should be an Object.

OAUTH_REQUEST_TYPE_POSTconstant 
public static const OAUTH_REQUEST_TYPE_POST:String = "OAUTH_REQUEST_TYPE_POST"

A string which is used in buildRequest that the returned data type should be a string, usable as POST data.

OAUTH_REQUEST_TYPE_URL_STRINGconstant 
public static const OAUTH_REQUEST_TYPE_URL_STRING:String = "OAUTH_REQUEST_TYPE_URL_STRING"

A string which is used in buildRequest that the returned data type should be a url encoded string.

OAUTH_REQUEST_TYPE_URL_VARIABLESconstant 
public static const OAUTH_REQUEST_TYPE_URL_VARIABLES:String = "OAUTH_REQUEST_TYPE_URL_VARIABLES"

A string which is used in buildRequest that the returned data type should be an URLVariables object.