BaseRequest.php
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
namespace AliyunMNS\Requests;
abstract class BaseRequest
{
protected $headers;
protected $resourcePath;
protected $method;
protected $body;
protected $queryString;
public function __construct($method, $resourcePath) {
$this->method = $method;
$this->resourcePath = $resourcePath;
}
abstract public function generateBody();
abstract public function generateQueryString();
public function setBody($body)
{
$this->body = $body;
}
public function getBody()
{
return $this->body;
}
public function setQueryString($queryString)
{
$this->queryString = $queryString;
}
public function getQueryString()
{
return $this->queryString;
}
public function isHeaderSet($header)
{
return isset($this->headers[$header]);
}
public function getHeaders()
{
return $this->headers;
}
public function removeHeader($header)
{
if (isset($this->headers[$header]))
{
unset($this->headers[$header]);
}
}
public function setHeader($header, $value)
{
$this->headers[$header] = $value;
}
public function getResourcePath()
{
return $this->resourcePath;
}
public function getMethod()
{
return $this->method;
}
}
?>