vendredi 11 décembre 2015

Laravel 5 request value null

This is code in my controller:

  public function postExample(Request $request) {

         $id = $request->input('subjectId');
         Log::warning('id is:' . $id . ",and request:" . $request);

The thing is that variable $id is null (empty string). Here is log:

 id is:,and request:POST      ....
 Accept:          application/json, text/plain, */*
 Accept-Encoding: gzip, deflate
 Content-Length:  19
 Content-Type:    application/x-www-form-urlencoded

         . . . .

 {"subjectId":"13"}  

I tried with:$id = $request->input('subjectId'); and its the same.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire