Posting and Responding with JSON
The next behavior we want to create will demonstrate how to parse and respond with JSON (as REST APIs tend to do).
Our goal is simple: A request contains JSON with a name, age, and money. We want to take those 3 fields, add $5000 to money and 10 years to age, and return a nicely formatted JSON response.
Getting Old and Rich(er)
Just like we did before, create a new behavior named AboutBehavior
inside the behaviors
package. Add the following content:
behaviors/AboutBehavior.java