Web Dev Basics Flashcards

1
Q

Under the hood http uses whic protocol(UDP or TCP) forcommunication?

A

It uses TCP under the hood.
As per http standard any reliable comm protocol can be used under the hood.Most widely used protocol is TCP.UDP cannot be used since it is not reliable.
TCP alspo ensures that the content like files images etc that we download reach our end fullt and securely.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the minimum basic elements in a http request?how are they organized?

A

Http request contain a status line,headers,and optional body.
A typical http request to htt://ww.google.com looks like this

GET / HTTP/1.1
Host: google.com
Accept_Language: en-us

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the 4 general types of response code?

A

In general there are 4 scenarios
request was a success(2xx)
request was somehow redirected(3xx)
client made an error(bad http request or accessing soimething that do not exist etc) (4xx)
server made an error (5xx)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between put and patch?Give 3.

A

Put
Used to update entire resource.
Entire resouce is obtsined from server which can be modified and the hole item is hen sent back for updation.
Idempotent.If you call the request multiple time data wont change.
Patch (Do more seriious research)
Sends the series of information on hpe to update the data.ENtire data may not be feetched from the server.
Not Idempotent.If you call the rquest muliple times same instructions will be used to patch twice.as a resuilt with every request data changes.
Since only partial data is sent or recieved Bandwidth req is lower.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly