API Docs for: undefined
Show:

YQLRESTClient Class

Methods

_buildAuthorizationHeader

(
  • oAuthParams
)
String private

Creates the OAuth Authorization Header

Parameters:

Returns:

_encode

(
  • string
)
String private

Performs the more strict version of URL Encode required by OAuth.

Parameters:

Returns:

_normalizeParameters

(
  • content
  • oAuthParams
  • query
)
String private

Performs paramater sorting and normalization required by OAuth.

Parameters:

  • content Object

    Parameters from POST or PUT body content

  • oAuthParams Object

    Parameters from OAuth

  • query Object

    Parameters from the query string.

Returns:

_randomString

() String private

Generates a random string containing digits and upper-case letters.

Returns:

request

(
  • params
  • callbackFunction
  • yqlParams
  • yqlOpts
)

Sends a REST request.

Parameters:

  • params Object

    Request parameters object.

    accept
    Specifies the type of content to send in the response using the Accept HTTP header. This tells YQL what kind of data format you want returned, as well as how to parse it.
    content
    The body content of a POST or PUT request. This can be an object or a string. If an object is used, contentType is assumed to be application/x-www-form-urlencoded.
    contentType
    Specifies the content-type of the body content of a POST or PUT request.
    fallbackCharsets
    Overrides the list of fallback character sets, which is set to "utf-8, iso-8859-1" by default, for decoding the returned response. YQL attempts to decode the response using the character sets listed here when the response either does not specify the character set or specifies an incorrect character set that results in a failed decoding. This value may be an array of strings or one string with comma separated values.
    forceCharset
    Forces YQL to use the character set specified. Using this overrides both the character set specified by the response and the fallback character sets.
    headers
    Adds HTTP headers to the request.
    jsonCompat
    Set this value to 'new' to get "lossless" JSON when making a REST call to a Web service. jsonCompat: 'new' must also be set in the yqlParams object.
    method
    The HTTP method to use. Must be one of 'DELETE', 'GET', 'HEAD', 'POST' or 'PUT'.
    oAuth
    oAuth is an object with the following members:
    consumer
    an object with two members: key and secret
    signatureMethod
    must be either 'HMAC-SHA1' or 'PLAINTEXT'
    token
    an optional object with three optional members: key, verifier, and secret.
    query
    Query parameters to add to the request.
    timeout
    Specifies the request timeout in milliseconds. This is useful when you want to cancel requests that take longer than expected.
    url
    Provides a URL endpoint to query. The url scheme and host must be lower case. If you are using the default port, there must not be a port specified in the url. Querystring parameters must be defined in the query member and not part of the url string.
  • callbackFunction Function

    The response object is the only parameter.

  • yqlParams Object

    (optional) Passes through to Y.YQL.

  • yqlOpts Object

    (optional) Passes through to Y.YQL.