HTTP Flashcards
HTTP
Hypertext Transfer Protocol
What is Hypertext Transfer Protocol?
The mechanism through which data is requested and provided on the world wide web.
The information sent by the client is called the _____.
request
- GET:
- DELETE:
- PUT:
- POST:
- GET: get the specified source.
- DELETE: delete a resource.
- PUT: replace it.
- POST: Send information to it.
What is a ‘resource’?
may be anything that can be transferred as if it is a file.
Which type of programming refers to programs that run on continuous loop to divert blocking operations to different handlers?
a. Synchronous programming
b. Asynchronous programming
b. Asynchronous programming.
• It runs on a loop and defers blocking operations to handlers in order to maintain a running state.
What are the three states that an es6 promise can have?
Pending, Fulfilled, Rejected
GET /17_http.html HTTP/1.1: What does the first word, GET, stand for?
GET stands for the method of request.
GET /17_http.html HTTP/1.1: What does /17_http.html stand for?
/17_http.html is the path of the resource the request applies to.
/17_http.html: What does HTTP/1.1 stand for?
HTTP/1.1 indicates the version of the HTTP protocol it is using.
Status code that starts with 2 indicate…
the request has succeeded.
Status code that starts with 4 indicate…
the request has failed.
Promises handle ________ functions in es6 by representing values that will at some point return in the future.
asynchronous
___ method retrieves data and has no secondary effect.
GET
___ method sends data to a server to add resources.
POST
Which HTTP request method retrieves data from a resource and has no secondary effect?
GET
Which of the following demonstrates a proper use of the fetch API function? Assume that ‘root’ is defined: root = ‘https://exampleapi/posts/1’.
a. fetch(root,{method:’GET’});
b. fetch().then(root).then(data = > data.json());
a. fetch(root,{method:’GET’});
_______ programming refers to programs that run sequentially, from top to bottom, that may or may not encounter blocking operations that affect the run time.
Synchronous
_______ programming refers to programs that run on a looped operation and divert blocking operations to handlers in order maintain the run time.
Asynchronous
User interfaces and browsers implements systems based on ________ programming in order to handle the unpredictability of user events such as clicks, mouse moves, and more.
asynchronous
ES6 ______ allow programs to handle asynchronous processes by representing values that will return at some point in the future.
promises
_____ defines the foundation for data communication over the world wide web.
HTTP
The ______ method begins to provides access in ES6 to HTTP request methods and grab data from apis by returning a promise that stands in for resulting data.
Fetch