1 | <?php |
||
11 | class Request implements LoggerAwareInterface |
||
12 | { |
||
13 | use LoggerAwareTrait; |
||
14 | |||
15 | /** |
||
16 | * Parameters to be send in the request. |
||
17 | * |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $parameters; |
||
21 | |||
22 | /** |
||
23 | * Headers to be send most likely to keep unchanged. |
||
24 | * |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $headers; |
||
28 | |||
29 | /** |
||
30 | * Adobe Connect API path |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $apiPath; |
||
35 | |||
36 | /** |
||
37 | * HTTP method to perform the request to the Adobe Connect API. |
||
38 | * Adobe Connect only supports 'POST' and 'GET' methods. |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $method = 'POST'; |
||
43 | |||
44 | /** |
||
45 | * Request constructor |
||
46 | * |
||
47 | * @param string $apiPath Path of the Adobe Connect API. |
||
48 | * @param array $parameters Parameters to be send to the API. |
||
49 | * @param array $headers Custom headers to be send to the API. |
||
50 | */ |
||
51 | public function __construct($apiPath, $parameters = [], $headers = []) |
||
59 | |||
60 | /** |
||
61 | * Adds a list of params to the request. |
||
62 | * |
||
63 | * @param array $parameters Hash table with parameters to be added. |
||
64 | * |
||
65 | * @return void |
||
66 | */ |
||
67 | public function addParameters($parameters) |
||
71 | |||
72 | /** |
||
73 | * Adds a single parameter. |
||
74 | * |
||
75 | * @return void |
||
76 | */ |
||
77 | public function addParameter($parameter, $value) |
||
81 | |||
82 | /** |
||
83 | * Return the request body to be sent to the Adobe Connect API. |
||
84 | * |
||
85 | * @return string |
||
86 | */ |
||
87 | public function getXMLBody() |
||
105 | |||
106 | /** |
||
107 | * Returns all headers set for the request. |
||
108 | * |
||
109 | * @return array |
||
110 | */ |
||
111 | public function getHeaders() |
||
115 | |||
116 | /** |
||
117 | * Sets a different HTTP method. |
||
118 | * |
||
119 | * @param string $method The http method to be used in API calls. |
||
120 | */ |
||
121 | public function setMethod($method) |
||
125 | |||
126 | /** |
||
127 | * Calls the remote Adobe Connect API. |
||
128 | * |
||
129 | * @return Response |
||
130 | */ |
||
131 | public function send() |
||
139 | |||
140 | /** |
||
141 | * Calls the remote Adobe Connect API using HTTP POST method. |
||
142 | * |
||
143 | * @return Response |
||
144 | */ |
||
145 | public function post() |
||
169 | } |
||
170 |