Oliver Wilms · Apr 24, 2020 2m read

REST for Tasks on my Status Report

I enjoy the challenge of being in a contest. Currently I participate in InterSystems IRIS with REST API Programming Contest. My idea for this contest was to create an app to help me keep track of tasks for my Status Reports. I started with the template provided by Evgeny Shvarov. I created a persistent class for Tasks and a REST Dispatch class. I defined my URL map and I even figured out how to test my REST app using Postman. I felt proud of myself for a little while. Then I noticed It seemed odd to type my tasks in JSON format in Postman and submit a POST request to get a new task into my app.

I am not a front-end developer, but I have some experience using Cache Server Pages (CSP). I had trouble saving the simplest page. I am glad I had discovered Discord where I can interact with other developers. Yesterday Lorenzo Scalese helped me troubleshoot my Web application definition was missing a physical path. I shared I was trying to make a CSP page to send POST request /rest/task/newtask to my REST app. Henrique Diaz joined our conversation and suggested YouTube video “Building Modern Web Applications”. I explained I was not a front-end developer and I did not use Angular. I stated I wanted to try to use %CSP.Page. Lorenzo Scalese told me I should use a javascript framework like jQuery. I wondered how to do it without using anything "extra". Lorenzo said, “I think, it's just impossible because, the standard behavior of a submit does not offer this feature.”  Evgeny Shvarov joined our conversation and said, “I don't know why you need CSP with REST API. REST API mostly is aimed to onboard ANY js frameworks which consume JSON.”  I received encouragement to pursue becoming familiar with modern technologies. I even started an Angular crash course. I did not think I had time to learn Angular for this contest. At least I wanted to prove I could do what Lorenzo thought was impossible. I am proud to report I was able to get a CSP page to submit a JSON POST request and it successfully created a new task in my task table. Do you think there is value in what I did or I just wasted time?

0 165
Discussion (1)1
Log in or sign up to continue

Oliver! Thanks for sharing! I'm sure you can estimate for yourself if this is the value, but personally I see a lot of value in the fact that engineers united to share experience and to help solve problems. And congrats to you with making REST API and JSON work for you! 

And I welcome everyone to Discord chat - we are sharing experience and having fun there!