A response is not limited to the body. Learn how to access and verify the header of a response.
- [Instructor] As a reminder, a response … is not limited to the body. … It also contains headers. … Let's print the headers of our response … to see what it contains. … To do so, we'll modify this get products, … test a little bit, … and we'll change the log from body to headers. … And let's print this out just to see what's there … in the headers. … In the output, we see the headers. … In each line here is a single header. … We see there are many headers returned, … such as the server that this is run against, … the date of the response, … the content type and so on. … Now, while all of this information is provided, … it's not always necessary to verify all of it. … This again is one of the times where you need … to make a judgment call. … The one header here that seems pretty important … to verify is the content type that's returned. … For example, if your API supports both XML and JSON formats, … you want to make sure that the response … is in the correct format. … Otherwise, your consumer's program will break …
Skill Level Intermediate
API setup3m 46s
1. Getting Started with REST Assured
REST Assured testing library3m 29s
2. Making API Requests
3. Validating API Responses
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.