protected function dumpRequest(Request $request) {
    $body = $request->getBody();
    
    $dump = "Body of request is:\n";
    
    if (is_object($body) || is_array($body)) {
      $dump .= json_encode($body);
    } elseif(is_string($body)) {
      $dump .= sprintf('"%s"',$body);
    }
    
    return $dump;
  }