You are here

protected function Request::parseBody in RESTful 7.2

Parses the body.

Parameters

string $method: The HTTP method.

Return value

array The parsed body.

1 call to Request::parseBody()
Request::getParsedBody in src/Http/Request.php
Parses the body string.

File

src/Http/Request.php, line 296
Contains \Drupal\restful\Http\Request

Class

Request
Deals with everything coming from the consumer.

Namespace

Drupal\restful\Http

Code

protected function parseBody($method) {
  if (!static::isWriteMethod($method)) {
    return NULL;
  }
  $content_type = $this
    ->getHeaders()
    ->get('Content-Type')
    ->get();
  $content_type = reset($content_type);
  $content_type = $content_type ?: 'application/x-www-form-urlencoded';
  return static::parseBodyContentType($content_type);
}