|
@@ -288,23 +288,10 @@ class Request
|
|
*/
|
|
*/
|
|
public function __toString()
|
|
public function __toString()
|
|
{
|
|
{
|
|
- // status
|
|
|
|
- $content = sprintf('%s %s %s', $this->getMethod(), $this->getRequestUri(), $this->server->get('SERVER_PROTOCOL'))."\r\n";
|
|
|
|
-
|
|
|
|
- $beautifier = function ($name) {
|
|
|
|
- return preg_replace('/\-(.)/e', "'-'.strtoupper('\\1')", ucfirst($name));
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- // headers
|
|
|
|
- foreach ($this->headers->all() as $name => $values) {
|
|
|
|
- foreach ($values as $value) {
|
|
|
|
- $content .= sprintf("%s: %s\r\n", $beautifier($name), $value);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- $content .= "\r\n".$this->getContent();
|
|
|
|
-
|
|
|
|
- return $content;
|
|
|
|
|
|
+ return
|
|
|
|
+ sprintf('%s %s %s', $this->getMethod(), $this->getRequestUri(), $this->server->get('SERVER_PROTOCOL'))."\r\n".
|
|
|
|
+ $this->headers."\r\n".
|
|
|
|
+ $this->getContent();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|