Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
responsebuilder.php
1<?php
2
10namespace Bitrix\Main\Web\Http;
11
13
15{
20 public function createFromString(string $response): Response
21 {
22 $headers = HttpHeaders::createFromString($response);
23 $body = $this->createBody();
24
25 if (strtolower($headers->get('Transfer-Encoding') ?? '') == 'chunked')
26 {
27 $body = new DechunkStream($body);
28 }
29
30 if (strtolower($headers->get('Content-Encoding') ?? '') == 'gzip')
31 {
32 $body = new InflateStream($body);
33 }
34
35 return new Response($headers->getStatus(), $headers->getHeaders(), $body, $headers->getVersion(), $headers->getReasonPhrase());
36 }
37
38 protected function createBody(): Stream
39 {
40 return new Stream('php://temp', 'r+');
41 }
42}
static createFromString(string $response)