Bedi06 / Coursework-Planner

Your coursework planner
0 stars 0 forks source link

[TECH ED] Check out an API response #1

Open Bedi06 opened 1 year ago

Bedi06 commented 1 year ago

From Module-JS3 created by Dedekind561: CodeYourFuture/Module-JS3#35

Link to the coursework

http://api.tvmaze.com/shows/82/episodes

Why are we doing this?

This task will get trainees to really think about the response you get back from an API. In addition, it will encourage trainees to use Chrome Dev Tools to examine the response you get back from the server.

Look at a request in Chrome Dev Tools In Google Chrome, open dev tools network tab and enter this URL into the browser: http://api.tvmaze.com/shows/82/episodes

Answer the following questions:

What's the status code the server sent back? What HTTP method did the browser use to make the request? What is the request path? What is the first line of the response body? What is the value of the response header called "Content-Type" ? What is the value of the request header called "User-Agent"

Maximum time in hours

2

How to get help

No response

How to submit

Share your answers with the other trainees in your Buddy Group or on your Slack class channel. Did you get different answers to other people? Ask them how they worked them out!

How to review

No response

Anything else?

No response

Bedi06 commented 1 year ago

During our call withe the group of Scotland We discussed about different types of files like CVS , Xml and finally JSON,how they work and the format which are written and the conclusion was that the best amongst them is JSON because is more concise and takes less space and data . Here is how we answered the questions :

  1. What's the status code the server sent back?

Answer: 304

  1. What HTTP method did the browser use to make the request?

Answer: GET

  1. What is the request path?

Answer: http://api.tvmaze.com/shows/82/episodes

  1. What is the first line of the response body? (What is the first type of data?)

Answer: "id": 4952 if we have applied a formatter.

  1. What is the value of the response header called "Content-Type" ?

Answer: If we are talking about the viewer.css then the content type is: text/css and that of the nr-ext-select-icon.html file is : text/html

  1. What is the value of the request header called "User-Agent"

Answer: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36