Trying to build rest api using postman

Posted 9 months ago by nnnayeem

Hello everyone. Currently I am working on a project where I am sending data using postman to my laravel app. I want to use laravel raw while the content type is html or plain text and I want to capture the data in laravel controller. So far, I succeeded using json. But I dont want to use json. Everytime I send data It gets me empty array. I also disabled the csrf token for that route. The code is added below:

        //I tried using this but shows empty array
        
        public function getData(Request $request){
                $p = $_POST;
                dd($p);
   
            }




        //I also tried this

            public function getData(Request $request){
                dd($request->all());
   
            }

Everytime gives me empty array. I tried using html raw like following:

        <input type="hidden" name="testing" value="v1>

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.