Problems about the introduction of Request and Response in the use of slim

when using php"s lightweight slim framework, I found two introduction of Request and Response:
1. Slim\ Http\ Request;
2. \ Psr\ Http\ Message\ ServerRequestInterface
I wonder if there is a difference between the two?
if mixed, will it cause an error?

Jul.06,2021

using 1
2 is interface Ah


ServerRequestInterface is a Request interface based on PSR-7 specification

Request is an implementation of ServerRequestInterface

ServerRequestInterface should be injected when using dependency injection
only Request can be used in practical use

  • Error in how the slim framework customizes the request method

    for example, the POST request interface is specified, but a request from GET will report an error as shown in the following figure so how do you customize the returned errors? For example, { "error ": "Method not allowed "} is returned. ...

    Mar.01,2021
  • Who has used the slim,URL parameter?

    the following code: require vendor autoload.php ; $app->get( hello[ {name}] , function ($request, $response, $args) { $response->write("Hello, " . $args[ name ]); return $response; })->setArgument( name , World! ...

    Jul.22,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e49556-6533f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e49556-6533f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?