mardi 13 février 2018

I'm trying to call my own laravel api with POST method.. these are the routes

I'm trying to call my own laravel api with POST method but I am not getting the post values in get_cities_list method.

LocationController.php

public function get_cities(){
$params = array('country_id' => 1);
$req = Request::create('api/get_cities_list', 'POST', $params);
$response = json_decode(Route::dispatch($req)->getCOntent());
print_r($response);
}

Api/CommonController.php

public function get_cities_list(Request $request){
print_r($request->all()) //empty array
print_r($_POST) //empty array
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire