Hi, I have problem on trying to make a POST request to a custom LLRequestHandler, I have no problems with GET requests.
SCENARIO 1 (form-data encoded as application/x-www-form-urlencoded)
The form:
<form action="`url`?func=timetracker.addReport" method="post" class="form-inline" role="form"> <div class="form-group"> <input name="comment" type="text" class="form-control" id="comment"> </div> <button type="submit" class="btn btn-default">Submit</button></form>
And this is my LLRequestHandler (at the moment is doing nothing):
package TIMETRACKER::TimeTrackerHandlerpublic object addReport inherits TIMETRACKER::TimeTrackerLLRequestHandler override Boolean fEnabled = TRUE override List fAllowedMethods = { 'GET', 'POST' } override function Dynamic Execute(Dynamic ctxIn, Dynamic ctxOut, Record request ) Object prgCtx = .PrgSession() return Undefined end endWhen I submit the form in the CSIDE console I see the following.:
08:40:01,863 INFO Thu Jan 28 08:40:01 2016 - 56030455 Func='?' Timing: 0.057 0.057 0.057
SCENARIO 2 (form-data encoded as text/plain)
The form:
<form action="`url`?func=timetracker.addReport" method="post" class="form-inline" role="form" enctype="text/plain"> <div class="form-group"> <input name="comment" type="text" class="form-control" id="comment"> </div> <button type="submit" class="btn btn-default">Submit</button></form>
And this is my LLRequestHandler (at the moment is doing nothing):
package TIMETRACKER::TimeTrackerHandlerpublic object addReport inherits TIMETRACKER::TimeTrackerLLRequestHandler override Boolean fEnabled = TRUE override List fAllowedMethods = { 'GET', 'POST' } override function Dynamic Execute(Dynamic ctxIn, Dynamic ctxOut, Record request ) Object prgCtx = .PrgSession() return Undefined end endWhen I submit the form in the CSIDE console I see the following:
09:02:01,096 INFO Thu Jan 28 09:02:01 2016 - 736321 Func='timetracker.addReport' Timing: 5.739 5.739 5.740
In this case it reach the breackpoint inside the Execute() but I don't see the payload of my post in the "request" parameter.
Anyone knows what I'm doing wrong?