Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type
- TMvcTestMe = class(TMVCApplication)
- published
- procedure Test(
- const aCtxt: TRestServerUriContext
- );
- end;
- procedure TMVCTestMe.Test(const aCtxt: TRestServerUriContext);
- var
- a, b: double;
- begin
- if UrlDecodeNeedParameters(aCtxt.Parameters, 'A,B') then
- begin
- while aCtxt.Parameters <> nil do
- begin
- UrlDecodeDouble(aCtxt.Parameters, 'A=', a);
- UrlDecodeDouble(aCtxt.Parameters, 'B=', b, @aCtxt.Parameters);
- end;
- aCtxt.Returns(['result', True, 'Sum', a+b]);
- end
- else
- aCtxt.Returns(['result', False], HTTP_BADREQUEST)
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement