POST /members HTTP/1.1 Host: localhost Content-Type: application/json { "name" : "mike", "age" : 30 }
<?phpclass MemberController extends Controller{ function create() { $data = $this->reqest->getJSON(); // <-- parse JSON // codes.. }}
<?phpclass MemberTest extends FeatureTestCase{ public function testCreateMember() { $body = [ 'name' => 'mike', 'age' => 30, ]; $result = $this->post('member/v2/organs', $body); // codes.. }}
(08-03-2020, 09:28 AM)InsiteFX Wrote: Your MemberController is not extending the Controller class.