Lumen laravel middleware $request- > header ($key) cannot get a value

problem description

Middleware $request- > header ($key) cannot get a value

the environmental background of the problems and what methods you have tried

lumen was good before, but I don"t know why recently
tried $request- > headers- > aaa
tried $request- > header ("aaa")
other values can be obtained, but header can"t get

related codes

/ / Please paste the code text below (do not replace the code with pictures)

public function handle($request, Closure $next)
{
    var_dump($request->headers->get("aaa"));
    var_dump($request->header("aaa"));
}

what result do you expect? What is the error message actually seen?

expectation: valuable
error: null

Jan.10,2022

I have also encountered this problem, because I am using nginx, may be for some configuration reasons, the key value of header cannot be underlined _ , there can be -. For reference only.


first check whether the Header requested by http has the value you need
, and then look at the document or source code. I feel that the possibility of error in the source code is extremely low, so focus on the correct use of the document

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-1e4c1e0-59ed9.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-1e4c1e0-59ed9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?