Empty json body in Lumen testing?

Failed to get json body with request like this?

$this->call('PATCH', '/api/v1/sessions/UUID/quantity',
            [],
            [],
            [],
            ['CONTENT_TYPE' => 'application/json'],
            json_encode(['quantity' => 10])
        );

or

$this->json('PATCH', '/api/v1/sessions/UUID/quantity',
            ['quantity' => 10]
        );

Make sure you are using this package for the request instance:

use Illuminate\Http\Request;

Posted

in

by

Tags:

Comments

Leave a Reply