Skip to content

Slim3 Response::withBody($string) #1410

@rustyJ4ck

Description

@rustyJ4ck

Sending response with string body raise an error:

Catchable fatal error: Argument 1 passed to Slim\Http\Response::withBody() must implement interface Psr\Http\Message\StreamInterface, string given

From migration guide:

$app->get('/', function ($req, $res, $args) {
    return $res->withStatus(400)->withBody("Bad Request");
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions