XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
Request.php
Go to the documentation of this file.
1 <?php
2 require_once 'HTTP/Request2.php';
3 
5 {
6  private $reponse = null;
7 
8  public function addHeader($name, $value)
9  {
10  $this->setHeader($name, $value);
11  }
12 
13  public function sendRequest($saveBody = true)
14  {
15  $response = $this->send();
16  $this->response = $response;
17  return $response;
18  }
19 
20  public function getResponseCode() {
21  if($this->response)
22  {
23  return $this->response->getStatus();
24  }
25  }
26 
27  public function getResponseHeader() {
28  if($this->response)
29  {
30  return $this->response->getHeader();
31  }
32  }
33 
34  public function getResponseBody() {
35  if($this->response)
36  {
37  return $this->response->getBody();
38  }
39  }
40 
41  public function getResponseCookies() {
42  if($this->response)
43  {
44  return $this->response->getCookies();
45  }
46  }
47 
48  public function addPostData($name, $value, $preencoded = false)
49  {
50  $this->addPostParameter($name, $value);
51  }
52 
53 }
54 
55 ?>
getResponseCode()
Definition: Request.php:20
getResponseCookies()
Definition: Request.php:41
sendRequest($saveBody=true)
Definition: Request.php:13
addHeader($name, $value)
Definition: Request.php:8
addPostData($name, $value, $preencoded=false)
Definition: Request.php:48
getResponseBody()
Definition: Request.php:34
setHeader($name, $value=null, $replace=true)
Definition: Request2.php:474
addPostParameter($name, $value=null)
Definition: Request2.php:700
getResponseHeader()
Definition: Request.php:27