Web Theory Flashcards
Understand web concepts like HTTP1 vs 2, how the internet works, and etc
What’s the difference between GET and POST?
GET is basically used for just getting (retrieving) some data from the server. Note: The GET method may return cached data. The POST method NEVER caches data, and creates/updates a resource in a HTTP request.
- The POST method does not have any restriction on data size to be sent.
- The POST method can be used to send ASCII as well as binary data.
- GET method is use to send the less sensitive data whereas POST method is use to send the sensitive data.
- GET parameters are stored in server logs, and browser history.
- Back is harmless with GET, but with post data has to be resubmitted.
Explain the REST architecture.
An architecture style for designing loosely coupled applications over HTTP. Lookups happen using CRUD. with conventions (i.e. REST codes). Stateless.
What is 200, 300, 400, and 500 in a REST APIs?
- 1XX Informational
- 2XX Success (200/ok, 201/created, 204/no content)
- 3XX Redirection (304/not modified)
- 4XX Client Error (400/bad request, 401/unathorized, 403/forbidden, 404/not found, 409/conflict)
- 5XX Server Error (500/Internal Server Error)
Why would someone need to overwrite the .equals() method in a Java class?
Override the equals method to check if the data is the same rather than the reference. Also need to override the hashcode bc equal objects may get different hash-values (values may be equal, but don’t hash to the same bucket).
Ref: https://stackoverflow.com/questions/2265503/why-do-i-need-to-override-the-equals-and-hashcode-methods-in-java
What is the main difference between HTTP 1.0 and 2?
“HTTP/2 supports queries multiplexing, headers compression, priority and more intelligent packet streaming management. This results in reduced latency and accelerates content download on modern web pages.”
“HTTP/2 is a binary protocol. Every HTTP/2 request and response is given a unique id called as stream id and an HTTP request & response is divided into frames”
Ref: http://qnimate.com/what-is-multiplexing-in-http2/
What is query multiplexing?
Multiplexing is a method in HTTP/2 by which multiple HTTP requests can be sent and responses can be received asynchronously via a single TCP connection.