# Class RESTian_Request

A RESTian_Request represents a specific HTTP request

Located at core-classes/class-request.php

Methods summary
`public` | # `__construct( array $vars = array(), array $args = array() )` #### Parameters $vars `array` $vars $args `array` $args
`public boolean` | # `has_credentials( )` Check $this->auth to determine if it contains credentials. Check $this->auth to determine if it contains credentials. Does NOT verify if credentials are valid, only that it has them. This class will be extended when we have a proper use-case for extension. #### Returns `boolean`
`public boolean|array` | # `get_credentials( )` #### Returns `boolean|array`
`public mixed` | # `set_credentials( mixed $credentials )` #### Parameters $credentials `mixed` $credentials #### Returns `mixed`
`public boolean|array` | # `get_grant( )` #### Returns `boolean|array`
`public mixed` | # `set_grant( mixed $grant )` #### Parameters $grant `mixed` $grant #### Returns `mixed`
`public boolean|`RESTian_Service`` | # `get_auth_service( )` #### Returns `boolean|`RESTian_Service``
`public` | # `add_header( mixed $name, mixed $value )` #### Parameters $name `mixed` $name $value `mixed` $value
`public` | # `add_headers( array $headers = array() )` #### Parameters $headers `array` $headers
`public array` | # `get_headers( )` #### Returns `array`
`public` | # `clear_headers( )`
`public boolean|string` | # `get_body( )` #### Returns `boolean|string`
`public array` | # `get_curl_headers( )` Returns HTTP headers as expected by CURL. Returns HTTP headers as expected by CURL. Returns numeric indexed array where value contains header name and header value as "{$name}: {$value}" #### Returns `array`
`public boolean|string` | # `get_url( )` #### Returns `boolean|string` #### Throws ``Exception``
`public boolean` | # `has_grant( )` Returns true if RESTian can safely assume that we have authenticated in past with existing credentials. Returns true if RESTian can safely assume that we have authenticated in past with existing credentials. This does NOT mean we ARE authenticated but that we should ASSUME we are and try doing calls without first authenticating. This functionality is defined because the client (often a WordPress plugin) may have captured grant info from a prior page load where this class did authenticate, but this class is not in control of maintaining that grant info so we can only assume it is correct if the client of this code tells us it is by giving us grant info that the auth provider validates. Another use-case where our assumption will fail is if the access_key expires or has since been revoked. #### Returns `boolean`
`public object|`RESTian_Response`` | # `make_request( )` Call the API. Call the API. On success (HTTP status == 200) $this->error_code and $this->error_msg will be false. On failure (HTTP status != 200) $this->error_code and $this->error_msg will contain error information. On success or failure, $this->response will contain the response captured by HTTP agent except when username and password are not passed as part of auth. #### Returns `object|`RESTian_Response``
`public boolean` | # `needs_authentication( )` #### Returns `boolean`
`public boolean` | # `has_authentication( )` #### Returns `boolean`
`public boolean|`RESTian_Settings`` | # `get_settings( )` #### Returns `boolean|`RESTian_Settings``
`public boolean` | # `get_content_type( )` #### Returns `boolean`
`public` | # `assign_settings( )`

Properties summary
`protected boolean|array` | $_credentials | `false` | #
`protected boolean|array` | $_grant | `false` | #
`protected array` | $_headers | `array()` | #
`protected `RESTian_Service`` | $_auth_service | `false` | # Optional to override the one set in the API, if needed. Optional to override the one set in the API, if needed.
`public `RESTian_Client`` | $client | `` | #
`public `RESTian_Service`` | $service | `` | #
`public string` | $http_method | `'GET'` | #
`public boolean` | $sslverify | `false` | # Specifies that SSL should not be verified by default. When true it is often too problematic for WordPress plugins. Specifies that SSL should not be verified by default. When true it is often too problematic for WordPress plugins.
`public `RESTian_Response`` | $response | `` | #
`public array` | $vars | `` | #
`public string` | $body | `` | #
`public boolean` | $omit_body | `false` | # #### TODO These should be moved to RESPONSE, not be in REQUEST.
`public boolean` | $omit_result | `false` | #