From the course: Learning Koa

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Response with context

Response with context

From the course: Learning Koa

Start my 1-month free trial

Response with context

- [Instructor] Now, let's take a look at the response object. Like the request object, there are tons of information available on the request object, information you can use for your application, so, go to koajs.com, and then, select the response section, and as you scroll, just looking at some of the items you can use, you can return the status, the length, and many others. So, let's play a little bit with our code to demonstrate some examples. So, let's go back to VS Code, and now, what we're going to do is change some of the code here and add some new things to actually test the response. So, we already have a response, and if you did realize, this here is the response, and we could literally change this to response.body, save this, and then go back to our server and refresh, and the same thing happens, so, this is the response and it's part of the response object here. So, we're going to comment some of the code here so we can actually test new code, and I'm going to leave this…

Contents