I could make request as follows:
perl -d ./script/myapp.pl get -M POST -H 'Content-Type:
application/x-www-form-urlencoded' -c 'user=username&password=thisspass' /
auth
Thanks you again!
понедельник, 5 декабря 2016 г., 12:45:16 UTC+8 пользователь
mongo...@gmail.com написал:
>
> Can I transfer f
Can I transfer form's params from command line with POST request? I read
the doc and don't understand, how I can do it. Or for this I need use
test's?
I wouldn't trust "ctrl+c", because it just breaks the debugger at some
> random point in the code (probably somewhere unhelpful inside the event
You can make a POST request with the get command :
http://mojolicious.org/perldoc/Mojolicious/Command/get
But when your arguments get complicated, it might be best to just write
a test - using Test::Mojo - and run that in the debugger:
http://mojolicious.org/perldoc/Mojolicious/Guides/Growing#to
Thank you!
It's work. For one GET request, for example.
But, how I can send POST request? (I am testing code in module
authentication)
And moreover, how I can run and still application in perldebug mode, and
from time to time, stopping him by "ctrl+c", set breakpoint watch vars, and
continue app
perl -d script/my_app get
/route/to/controller
Stepping through mojo code until it reaches your startup() method
is tricky and time-consuming.
The best way to avoid all that is to add the line
$DB::single = 1;
inside your startup() method code.