| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- <?php
- /*
- * This file is part of the php-phantomjs.
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
- namespace JonnyW\PhantomJs\Http;
- /**
- * PHP PhantomJs
- *
- * @author Jon Wenmoth <contact@jonnyw.me>
- */
- interface RequestInterface
- {
- const METHOD_OPTIONS = 'OPTIONS';
- const METHOD_GET = 'GET';
- const METHOD_HEAD = 'HEAD';
- const METHOD_POST = 'POST';
- const METHOD_PUT = 'PUT';
- const METHOD_DELETE = 'DELETE';
- const METHOD_PATCH = 'PATCH';
- const REQUEST_TYPE_DEFAULT = 'default';
- const REQUEST_TYPE_CAPTURE = 'capture';
- const REQUEST_TYPE_PDF = 'pdf';
- /**
- * Get request type
- *
- * @access public
- * @return string
- */
- public function getType();
- /**
- * Set request method
- *
- * @access public
- * @param string $method
- */
- public function setMethod($method);
- /**
- * Get request method
- *
- * @access public
- * @return string
- */
- public function getMethod();
- /**
- * Set timeout period
- *
- * @access public
- * @param int $timeout
- */
- public function setTimeout($timeout);
- /**
- * Get timeout period
- *
- * @access public
- * @return int
- */
- public function getTimeout();
- /**
- * Set page load delay time.
- *
- * @access public
- * @param int $delay
- */
- public function setDelay($delay);
- /**
- * Get page load delay time.
- *
- * @access public
- * @return int
- */
- public function getDelay();
- /**
- * Set viewport size.
- *
- * @access public
- * @param int $width
- * @param int $height
- * @return void
- */
- public function setViewportSize($width, $height);
- /**
- * Get viewport width.
- *
- * @access public
- * @return int
- */
- public function getViewportWidth();
- /**
- * Get viewport height.
- *
- * @access public
- * @return int
- */
- public function getViewportHeight();
- /**
- * Set request URL
- *
- * @access public
- * @param string $url
- */
- public function setUrl($url);
- /**
- * Get request URL
- *
- * @access public
- * @return string
- */
- public function getUrl();
- /**
- * Get content body
- *
- * @access public
- * @return string
- */
- public function getBody();
- /**
- * Set request data
- *
- * @access public
- * @param array $data
- */
- public function setRequestData(array $data);
- /**
- * Get request data
- *
- * @access public
- * @param boolean $flat
- * @return array
- */
- public function getRequestData($flat = true);
- /**
- * Set headers
- *
- * @access public
- * @param array $headers
- */
- public function setHeaders(array $headers);
- /**
- * Add single header
- *
- * @access public
- * @param string $header
- * @param string $value
- */
- public function addHeader($header, $value);
- /**
- * Merge headers with existing
- *
- * @access public
- * @param array $headers
- */
- public function addHeaders(array $headers);
- /**
- * Get request headers
- *
- * @access public
- * @return array|string
- */
- public function getHeaders();
- /**
- * Set body styles
- *
- * @access public
- * @param array $styles
- */
- public function setBodyStyles(array $styles);
- /**
- * Get body styles
- *
- * @access public
- * @return array|string
- */
- public function getBodyStyles();
- }
|