Conditions | 3 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare( strict_types=1 ); |
||
12 | protected function reallyMakeRequest( string $params ): string { |
||
13 | $context = [ |
||
14 | 'http' => [ |
||
15 | 'method' => $this->method, |
||
16 | 'header' => $this->buildHeadersString( $this->getHeaders() ) |
||
17 | ] |
||
18 | ]; |
||
19 | $url = $this->url; |
||
20 | if ( $this->method === self::METHOD_POST ) { |
||
21 | $context['http']['content'] = $params; |
||
22 | } else { |
||
23 | $url = "$url?$params"; |
||
24 | } |
||
25 | $context = stream_context_create( $context ); |
||
26 | $body = file_get_contents( $url, false, $context ); |
||
27 | |||
28 | foreach ( $http_response_header as $header ) { |
||
29 | $this->handleResponseHeader( $header ); |
||
30 | } |
||
31 | |||
32 | return $body; |
||
33 | } |
||
35 |