3 namespace Zumba\GastonJS\Browser;
6 * Trait BrowserHeadersTrait
7 * @package Zumba\GastonJS\Browser
9 trait BrowserHeadersTrait {
11 * Returns the headers of the current page that will be used the next request
14 public function getHeaders() {
15 return $this->command('get_headers');
19 * Given an array of headers, set such headers for the requests, removing all others
20 * @param array $headers
23 public function setHeaders($headers) {
24 return $this->command('set_headers', $headers);
28 * Adds headers to current page overriding the existing ones for the next requests
32 public function addHeaders($headers) {
33 return $this->command('add_headers', $headers);
37 * Adds a header to the page making it permanent if needed
42 public function addHeader($header, $permanent = false) {
43 return $this->command('add_header', $header, $permanent);
47 * Gets the response headers after a request
50 public function responseHeaders() {
51 return $this->command('response_headers');