From the course: Java: Automated API Testing with REST Assured

Unlock the full course today

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

Anatomy of a response

Anatomy of a response - Java Tutorial

From the course: Java: Automated API Testing with REST Assured

Start my 1-month free trial

Anatomy of a response

- [Instructor] As a reminder, the communication between APIs consists of two parts, a request and a response. We nailed the request. Now let's focus on the API response. A response is what is returned as a result of an API request being made. The response is essentially comprised of three components, the HTTP status code, the headers, and the body. The status code is a numeric value that provides a quick indication of if the request was successful or not. For example, status code 200 means that everything went okay with the request, while a status code of 404 means the endpoint you attempted to send the request to does not exist. As many API consumers will do a quick check to make sure the request was successful before attempting to proceed further with the response, it's important for us to verify that the status code is indeed correct. The headers of a response contain information about cookies, pagination…

Contents