Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
65 | public function __toString() |
||
66 | { |
||
67 | $request = "{$this->getMethod()} {$this->getUrl()->getResource()} HTTP/{$this->getProtocolVersion()}\r\n"; |
||
68 | $request .= "Host: {$this->getUrl()->getHost()}\r\n"; |
||
69 | foreach ($this->getHeaders() as $headerName => $headerValue) { |
||
70 | $request .= "{$headerName}: {$headerValue}\r\n"; |
||
71 | } |
||
72 | |||
73 | if (null !== $this->getContent()) { |
||
74 | $request .= "\r\n{$this->getContent()}\r\n"; |
||
75 | } |
||
76 | |||
77 | $request .= "\r\n"; |
||
78 | |||
79 | return $request; |
||
80 | } |
||
81 | } |
||
82 |