@@ 263-272 (lines=10) @@ | ||
260 | * |
|
261 | * @return $this |
|
262 | */ |
|
263 | public function addHeader($header, $headerValue) |
|
264 | { |
|
265 | if (is_string($header) && is_string($headerValue)) { |
|
266 | $this->_config['headers'][$header] = $headerValue; |
|
267 | } else { |
|
268 | throw new InvalidException('Header must be a string'); |
|
269 | } |
|
270 | ||
271 | return $this; |
|
272 | } |
|
273 | ||
274 | /** |
|
275 | * Remove a HTTP Header. |
|
@@ 283-294 (lines=12) @@ | ||
280 | * |
|
281 | * @return $this |
|
282 | */ |
|
283 | public function removeHeader($header) |
|
284 | { |
|
285 | if (is_string($header)) { |
|
286 | if (array_key_exists($header, $this->_config['headers'])) { |
|
287 | unset($this->_config['headers'][$header]); |
|
288 | } |
|
289 | } else { |
|
290 | throw new InvalidException('Header must be a string'); |
|
291 | } |
|
292 | ||
293 | return $this; |
|
294 | } |
|
295 | ||
296 | /** |
|
297 | * Uses _bulk to send documents to the server. |