Returns the body for this endpoint.

@param string $method Method for this command.

@return string
762730
protected function getBody($method)
    {
        if ($method === "get") {
            return parent::getBody($method);
        }
        $acls = array();
        foreach ($this->getArguments() as $value) {
            $acls[] = $value;
        }
        return json_encode(array("acl" => $acls));
    }
686248
protected function getJoinpointInvocationBody(ReflectionMethod $method): string
    {
        $isStatic = $method->isStatic();
        $scope    = $isStatic ? 'static::class' : '$this';
        $prefix   = $isStatic ? AspectContainer::STATIC_METHOD_PREFIX : AspectContainer::METHOD_PREFIX;

        $argumentList = new FunctionCallArgumentListGenerator($method);
        $argumentCode = $argumentList->generate();
        $return = 'return ';
        if ($method->hasReturnType()) {
            $returnType = (string) $method->getReturnType();
            if ($returnType === 'void') {
                // void return types should not return anything
                $return = '';
            }
        }

        if (!empty($argumentCode)) {
            $scope = "$scope, $argumentCode";
        }

        $body = "{$return}self::\$__joinPoints['{$prefix}:{$method->name}']->__invoke($scope);";

        return $body;
    }
611746
public function getRoutesByMethod($method)
	{
		return ($this->routesByMethod && isset($this->routesByMethod[$method])) ? $this->routesByMethod[$method] : array();
	}
879757
public function getBody()
    {
        $body = '';
        if ($this->_method === 'POST' || $this->_method === 'PUT') {
            if ($this->_body === null) {
                $this->_body = $this->getPostBody();
            }
            $this->setHeader('content-length', strlen($this->_body));
            $body = $this->_body . Client::CRLF;
        }
        return $body;
    }
1031067
private static function getCalledMethod($method)
    {
        if (strpos($method, '::') !== false) {
            $methodChunks = explode('::', $method);
            $method = $methodChunks[1];
        }

        return $method;
    }
343589
public function get($method = null)
    {
        return is_null($method) ? $this->getRoutes() : Arr::get($this->routes, $method, []);
    }
994254
protected function fetchControllerSuffix($method = 'GET')
    {
        $method = strtoupper($method);

        // Validate that we have a map to handle the given HTTP method.
        if (!isset($this->suffixMap[$method])) {
            throw new \RuntimeException(sprintf('Unable to support the HTTP method `%s`.', $method), 404);
        }

        // Check if request method is POST
        if ($this->allowCustomMethod == true && strcmp(strtoupper($method), 'POST') === 0) {
            // Get the method from input
            $postMethod = $this->getCustomMethod();

            // Validate that we have a map to handle the given HTTP method from input
            if ($postMethod && isset($this->suffixMap[strtoupper($postMethod)])) {
                return ucfirst($this->suffixMap[strtoupper($postMethod)]);
            }
        }

        return ucfirst($this->suffixMap[$method]);
    }
1277951
protected function getJsMethod($method)
    {
        $methods = [
            'get' => 'read',
            'post' => 'create',
            'put' => 'update',
            'delete' => 'delete',
        ];
        return isset($methods[strtolower($method)]) ? $methods[strtolower($method)] : 'read';
    }
1323119
protected function getBody($method)
    {
        $file = $this->getArgument("sound_file");
        if (!is_null($file)) {
            return "file:$file";
        }
        return parent::getBody($method);
    }
527025
public function method( $method = false ) : string
	{
		if( true === $method ){
			return (isset( $this->server['request_method'] ) ?? $this->server['request_method']);
		} elseif( !$this->method ){
			if( isset( $_server['http_x_method_override'] ) ){
				$this->method = strtoupper( $this->server['http_x_method_override'] );
			} else{
				$this->method = strtoupper( isset( $this->server['request_method'] ) ? $this->server['request_method'] : null );
			}
		}
		return $this->method;
	}
658552
private function getMethodSignature($method)
    {
        $validMethod = isset($this->methods[$method])
            && is_array($this->methods[$method])
            && count($this->methods[$method]) >= 2;

        if ($validMethod) {
            return $this->methods[$method];
        }

        return null;
    }
847577
protected function getPhpdoc($method)
    {

        $reflect = false;
        
        foreach($this->served_classes as $class){
            if (\method_exists($class, $method)) {
                $reflect = new \ReflectionMethod($class, $method);
                break;
            }
        
        }
        
        $response = new \stdClass();
        
         if(!$reflect){
            $response->error = new \sb\JSON\RPC2\Error();
            $response->error->code = -32602;
            $response->error->message = "Invalid method parameters";
            return $response;
        }

        $response->phpdoc = $reflect->getDocComment();

        if (\preg_match("~@return (.*?) (.*?)\*/$~s", $response->phpdoc, $match)) {
            $response->return_type = $match[1];
        } else {
            $response->return_type = 'n/a';
        }

        return $response;
    }
572368
public function getMethod($method)
    {
        $method = \strtoupper($method);

        if (!isset($this->methods[$method])) {
            throw new \Exception('Method not found');
        }

        return $this->methods[$method];
    }
395262
protected function run($method)
    {
        $endpoint = $this->getEndpoint($method);
        $outputFile = $this->getArgument('accept_file');
        if (is_null($outputFile)) {
            $outputFile = $this->getArgument('accept_any_file');
        }
        if (is_null($outputFile)) {
            $outputFile = $this->getArgument('accept_sound_file');
        }
        $cType = $this->getContentType($method);
        $aCType = $this->getAcceptContentType($method);
        $this->delArgument('accept_file');
        $this->delArgument('accept_any_file');
        $this->delArgument('accept_sound_file');
        $body = $this->getBody($method);
        return $this->client->run(
            $endpoint,
            $method,
            $cType,
            $aCType,
            $body,
            $outputFile
        );
    }
706517
protected function getMethodBody(ReflectionMethod $method)
    {
        // Get file content for the method

        $file = new SplFileObject($method->getFileName());

        $methodBodyLines = iterator_to_array(
            new LimitIterator(
                $file,
                $method->getStartLine(),
                $method->getEndLine() - $method->getStartLine()
            )
        );

        return implode("\n", $methodBodyLines);
    }
510864
public function getUriRouteFor(string $method): ?Route
    {
        if (!$this->isMethodAllowed($method)) {
            return null;
        }

        return $this->uriRoutes[$method];
    }
727133
function getEndBody(): string {
    /** @var \yii\web\View|null $view */
    $view = \Yii::$app->view;
    if (!$view || !$view->hasMethod('endBody')) return '';
    return $this->captureOutput([$view, 'endBody']);
  }