i use postman test laravel , post method. create route in route.php
route::get('userdata/{email}/{pw}','androidappcontroller@getuser');
i can data controller, getuser function:
public function getuser(){ return 'asdasdas'; }
but url cant return like:
http://localhost:81/project/userdata?email=xxx@xxxx.com&pw=xxxxxxx therefore cannot use postman test how data return, cause going use android login function. postman keep return me object not found, , params cant set because url not that. function url http:localhost:81/project/userdata/xxx@xxxx.com/xxxxxx
any idea how change url postman support form?
your application not support get
parameters. can either add route handle parameters in app:
route::get('userdata','androidappcontroller@getuserquerystring')
where getuserquerystring
pass get
parameters getuser
or use mod_rewrite in .htaccess
:
rewritecond %{query_string} ^email=(.*)&pw=(.*)$ rewriterule ^/project/userdata$ /project/userdata/%1/%2 [l,r=301]
first option better, second quicker.
Comments
Post a Comment