© Christopher Pitt 2018
Christopher PittThe Definitive Guide to AdonisJshttps://doi.org/10.1007/978-1-4842-3390-0_4

4. Requests

Christopher Pitt1 
(1)
Cape Town, Western Cape, South Africa
 

Now that we’re able to render HTML forms, it’s time to think about what we do with the data users send to us. In this chapter, we’re going to take a look at what makes a Request object, and how we extract data from each request.

It’s also a great opportunity for us to extend our tests to be able to make requests to the application and verify that the responses we get back represent the data we expect. That way, we’ll know the moment we break something that a browser is using.

Updating Tests

Since we added the markup in the previous chapter, the tests have been broken. ...

Get The Definitive Guide to AdonisJs: Building Node.js Applications with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.