interface RequestInterface in RESTful 7.2
Hierarchy
- interface \Drupal\restful\Http\RequestInterface
Expanded class hierarchy of RequestInterface
All classes that implement RequestInterface
75 files declare their use of RequestInterface
- AccessToken__1_0.php in modules/
restful_token_auth/ src/ Plugin/ resource/ AccessToken__1_0.php - Contains Drupal\restful_token_auth\Plugin\resource\AccessToken__1_0.
- Articles__1_0.php in modules/
restful_example/ src/ Plugin/ resource/ node/ article/ v1/ Articles__1_0.php - Contains \Drupal\restful_example\Plugin\resource\node\article\v1\Articles__1_0.
- Articles__1_1.php in modules/
restful_example/ src/ Plugin/ resource/ node/ article/ v1/ Articles__1_1.php - Contains \Drupal\restful_example\Plugin\resource\node\article\v1\Articles__1_1.
- Authentication.php in src/
Plugin/ authentication/ Authentication.php - Contains \Drupal\restful\Plugin\authentication\Authentication
- AuthenticationInterface.php in src/
Plugin/ authentication/ AuthenticationInterface.php - Contains \Drupal\restful\Plugin\authentication\Authentication
File
- src/
Http/ RequestInterface.php, line 10 - Contains \Drupal\restful\Http\RequestInterface.
Namespace
Drupal\restful\HttpView source
interface RequestInterface {
const HEADER_CLIENT_IP = 'client_ip';
const HEADER_CLIENT_HOST = 'client_host';
const HEADER_CLIENT_PROTO = 'client_proto';
const HEADER_CLIENT_PORT = 'client_port';
const METHOD_HEAD = 'HEAD';
const METHOD_GET = 'GET';
const METHOD_POST = 'POST';
const METHOD_PUT = 'PUT';
const METHOD_PATCH = 'PATCH';
const METHOD_DELETE = 'DELETE';
const METHOD_PURGE = 'PURGE';
const METHOD_OPTIONS = 'OPTIONS';
const METHOD_TRACE = 'TRACE';
const METHOD_CONNECT = 'CONNECT';
/**
* Creates a new request with values from PHP's super globals.
*
* @return RequestInterface
* Request A Request instance
*/
public static function createFromGlobals();
/**
* Creates a Request based on a given URI and configuration.
*
* @param string $path
* The requested path.
* @param array $query
* The query string parameters being passed.
* @param string $method
* A valid HTTP method
* @param HttpHeaderBag $headers
* The headers for the request
* @param bool $via_router
* Boolean indicating that if the requested was created via the Drupal's
* menu router.
* @param string $csrf_token
* A CSRF token that applies to the current request.
* @param array $cookies
* An array of key value pairs containing information about the cookies.
* @param array $files
* An array of key value pairs containing information about the files.
* @param array $server
* An array of key value pairs containing information about the server.
*
* @return RequestInterface Request
* A Request instance
*/
public static function create($path, array $query = array(), $method = 'GET', HttpHeaderBag $headers = NULL, $via_router = FALSE, $csrf_token = NULL, array $cookies = array(), array $files = array(), array $server = array());
/**
* Determines if the HTTP method represents a write operation.
*
* @param string $method
* The method name.
*
* @return boolean
* TRUE if it is a write operation. FALSE otherwise.
*/
public static function isWriteMethod($method);
/**
* Determines if the HTTP method represents a read operation.
*
* @param string $method
* The method name.
*
* @return boolean
* TRUE if it is a read operation. FALSE otherwise.
*/
public static function isReadMethod($method);
/**
* Determines if the HTTP method is one of the known methods.
*
* @param string $method
* The method name.
*
* @return boolean
* TRUE if it is a known method. FALSE otherwise.
*/
public static function isValidMethod($method);
/**
* Helper method to know if the current request is for a list.
*
* @param string $resource_path
* The resource path without any prefixes.
*
* @return boolean
* TRUE if the request is for a list. FALSE otherwise.
*/
public function isListRequest($resource_path);
/**
* Parses the body string.
*
* @return array
* The parsed body.
*/
public function getParsedBody();
/**
* Parses the input data provided via URL params.
*
* @return array
* The parsed input.
*/
public function getParsedInput();
/**
* Parses the input data provided via URL params.
*
* @param array $input
* The input to set.
*/
public function setParsedInput(array $input);
/**
* Gets the request path.
*
* @param bool $strip
* If TRUE it will strip the restful API prefix from the beginning.
*
* @return string
* The path.
*/
public function getPath($strip = TRUE);
/**
* Gets the fully qualified URL with the query params.
*
* @return string
* The URL.
*/
public function href();
/**
* Gets the headers bag.
*
* @return HttpHeaderBag
*/
public function getHeaders();
/**
* Returns the user.
*
* @return
* string|null
*/
public function getUser();
/**
* Returns the password.
*
* @return
* string|null
*/
public function getPassword();
/**
* Get the HTTP method.
*
* @return string
*/
public function getMethod();
/**
* Set the HTTP method.
*
* @param string $method
* The method to set.
*/
public function setMethod($method);
/**
* Get the server information.
*
* @return array
*/
public function getServer();
/**
* Sets an object in the application data store.
*
* @param string $key
* Identifier.
* @param mixed $value
* The data to store as part of the request.
*/
public function setApplicationData($key, $value);
/**
* Resets the application data.
*/
public function clearApplicationData();
/**
* Gets an object from the application data store.
*
* @param string $key
* Identifier.
*
* @return mixed
* The data stored as part of the request.
*/
public function getApplicationData($key);
/**
* Checks whether the request is secure or not.
*
* This method can read the client port from the "X-Forwarded-Proto" header
* when trusted proxies were set via "setTrustedProxies()".
*
* The "X-Forwarded-Proto" header must contain the protocol: "https" or
* "http".
*
* If your reverse proxy uses a different header name than "X-Forwarded-Proto"
* ("SSL_HTTPS" for instance), configure it via "setTrustedHeaderName()" with
* the "client-proto" key.
*
* @return bool
*/
public function isSecure();
/**
* Get the files in the request.
*
* @return array
* The available files in the request.
*/
public function getFiles();
/**
* Get CSRF Token.
*
* @return string
* Gets the CSRF token.
*/
public function getCsrfToken();
/**
* Is via router.
*
* @return bool
* TRUE if the request was generated via the Drupal's menu router.
*/
public function isViaRouter();
/**
* Marks the request as being via Drupal's menu router.
*
* @param bool $via_router
* The flag to set.
*/
public function setViaRouter($via_router);
/**
* @return array
*/
public function getCookies();
/**
* Get the normalized pager input.
*
* This is to support page=1&range=6 and page[number]=1&page[size]=6 at the
* same time.
*
* @return array
* An associative array with the pager information in the form of
* page[number]=1&page[size]=6.
*/
public function getPagerInput();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RequestInterface:: |
public | function | Resets the application data. | 1 |
RequestInterface:: |
public static | function | Creates a Request based on a given URI and configuration. | 1 |
RequestInterface:: |
public static | function | Creates a new request with values from PHP's super globals. | 1 |
RequestInterface:: |
public | function | Gets an object from the application data store. | 1 |
RequestInterface:: |
public | function | 1 | |
RequestInterface:: |
public | function | Get CSRF Token. | 1 |
RequestInterface:: |
public | function | Get the files in the request. | 1 |
RequestInterface:: |
public | function | Gets the headers bag. | 1 |
RequestInterface:: |
public | function | Get the HTTP method. | 1 |
RequestInterface:: |
public | function | Get the normalized pager input. | 1 |
RequestInterface:: |
public | function | Parses the body string. | 1 |
RequestInterface:: |
public | function | Parses the input data provided via URL params. | 1 |
RequestInterface:: |
public | function | Returns the password. | 1 |
RequestInterface:: |
public | function | Gets the request path. | 1 |
RequestInterface:: |
public | function | Get the server information. | 1 |
RequestInterface:: |
public | function | Returns the user. | 1 |
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
public | function | Gets the fully qualified URL with the query params. | 1 |
RequestInterface:: |
public | function | Helper method to know if the current request is for a list. | 1 |
RequestInterface:: |
public static | function | Determines if the HTTP method represents a read operation. | 1 |
RequestInterface:: |
public | function | Checks whether the request is secure or not. | 1 |
RequestInterface:: |
public static | function | Determines if the HTTP method is one of the known methods. | 1 |
RequestInterface:: |
public | function | Is via router. | 1 |
RequestInterface:: |
public static | function | Determines if the HTTP method represents a write operation. | 1 |
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
public | function | Sets an object in the application data store. | 1 |
RequestInterface:: |
public | function | Set the HTTP method. | 1 |
RequestInterface:: |
public | function | Parses the input data provided via URL params. | 1 |
RequestInterface:: |
public | function | Marks the request as being via Drupal's menu router. | 1 |