Hey guys,
The class \Illuminate\Foundation\Testing\Concerns\MakesHttpRequests
is used by Laravel in test cases so you can test and endpoint (like $this->post
) the bug I am facing is that if I call $request->getContent();
in my controller it will return empty string. This only happens in test environments. Normal behaviour of Laravel requests is that getContent
will return the raw body of the request.
So to sum up: Request::getContent
returns empty string in test environment, but raw body of request in live environment.
Does anybody know how to get the raw body of a request in test environment?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community