Skip to content

Commit

Permalink
added the request content to the request data collector
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Apr 15, 2011
1 parent 855206f commit ad112da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Expand Up @@ -75,6 +75,16 @@

{% include 'WebProfilerBundle:Profiler:bag.html.twig' with { 'bag': collector.requestheaders } only %}

<h2>Request Content</h2>

<p>
{% if collector.content %}
<pre>{{ collector.content }}</pre>
{% else %}
<em>No content</em>
{% endif %}
</p>

<h2>Request Server Parameters</h2>

{% include 'WebProfilerBundle:Profiler:bag.html.twig' with { 'bag': collector.requestserver } only %}
Expand Down
Expand Up @@ -46,6 +46,7 @@ public function collect(Request $request, Response $response, \Exception $except

$this->data = array(
'format' => $request->getRequestFormat(),
'content' => $request->getContent(),
'content_type' => $response->headers->get('Content-Type') ? $response->headers->get('Content-Type') : 'text/html',
'status_code' => $response->getStatusCode(),
'request_query' => $request->query->all(),
Expand Down Expand Up @@ -99,6 +100,11 @@ public function getSessionAttributes()
return $this->data['session_attributes'];
}

public function getContent()
{
return $this->data['content'];
}

public function getContentType()
{
return $this->data['content_type'];
Expand Down

0 comments on commit ad112da

Please sign in to comment.