src/Leevel/Http/ApiResponse.php
public function created(?string $location = null, $content = ''): IResponse
    {
        if ($this->checkFlowControl()) {
            return $this;
        }

        $this->setData($content);
        $this->setStatusCode(static::HTTP_CREATED);

        if (null !== $location) {
            $this->setHeader('Location', $location);
        }

        return $this;
    }
public function created(?string $location = null, $content = ''): IResponse
    {
        if ($this->checkFlowControl()) {
            return $this;
        }

        $this->setData($content);
        $this->setStatusCode(static::HTTP_CREATED);

        if (null !== $location) {
            $this->setHeader('Location', $location);
        }

        return $this;
    }
已创建
成功请求并创建了新的资源: 201.

@param null|string $location
@param mixed       $content

@return $this