Professional Documents
Culture Documents
GGG
GGG
1. GET: Retrieves data from the server (should only retrieve data and
should have no other effect).
2. POST: Sends data to the server for a new entity. It is often used
when uploading a file or submitting a completed web form.
3. PUT: Similar to POST, but used to replace an existing entity.
4. PATCH: Similar to PUT, but used to update only certain fields
within an existing entity.
5. DELETE: Removes data from the server.
6. TRACE: Provides a means to test what a machine along the
network path receives when a request is made. As such, it simply returns
what was sent.
7. OPTIONS: Allows a client to request information about the request
methods supported by a service. The relevant response header is Allow
and it simply lists the supported methods. (It can also be used to request
information about the request methods supported for the server where the
service resides by using a * wildcard in the URI.)
8. HEAD: Same as the GET method for a resource, but returns only
the response headers (i.e., with no entity-body).
9. CONNECT: Primarily used to establish a network connection to a
resource (usually via some proxy that can be requested to forward an
HTTP request as TCP and maintain the connection). Once established, the
response sends a 200 status code and a “Connection Established”
message.
10. A stateless communications protocol treats each request as an
independent transaction. It therefore does not require the server to retain
any session, identity, or status information spanning multiple requests from
the same source. Similarly, the requestor can not rely on any such
information being retained by the responder.
11. In contrast, a stateful communications protocol is one in which the
responder maintains “state” information (session data, identity, status, etc.)
across multiple requests from the same source.
12. HTTP is a stateless protocol. HTTP does not require server to
retain information or status about each user for the duration of multiple
requests.
13. Some web servers implement states using different methods (using
cookies, custom headers, hidden form fields etc.). However, in the very
core of every web application everything relies on HTTP which is still a
stateless protocol that is based on simple request/response paradigm.
Both are methods used in HTTP requests. Generally it is said that GET
is to download data and PUT is to upload data. But we can do both
downloading as well as uploading either by GET/POST.
GET:
POST:
Public
Protected
Private
Default
10. What is the difference between public, static and void?
public :The keyword public is an access modifier that tells the C#
compiler that the Main method is accessible by anyone.
static :The keyword static declares that the Main method is a
global one and can be called without creating an instance of the
class. The compiler stores the address of the method as the entry
point and uses this information to begin execution before any
objects are created.
void : The keyword void is a type modifier that states that the
Main method does not return any value.
In the last article we discussed OOPs Concepts. If you have not yet
checked it out, I would highly recommend you to read it so that you have
a basic overview of all the Object Oriented Programming Concepts. In
this guide, we will discuss four important features of OOPs with the help
of real life examples.
Encapsulation
This post provides the theoretical explanation of Encapsulation with real-
life examples. For detailed explanation on this topic with java programs
refer encapsulation in java with example.
Encapsulation is:
Inheritance
This post provides the theoretical explanation of inheritance with real-life
examples. For detailed explanation on this topic with java programs
refer inheritance with examples and types of inheritance in java.
A car can have further classification such as an open car, small car, big
car etc, which will acquire the properties from both Four Wheeler and
Car, but will still have some specific properties. This way the level of
hierarchy can be extended to any level.
Java Swing and Awt classes represent best examples for inheritance.
Polymorphism
This post provides the theoretical explanation of polymorphism with real-
life examples. For detailed explanation on this topic with java programs
refer polymorphism in java and runtime & compile time polymorphism.
What is an exception?
An Exception is an unwanted event that interrupts the normal flow of the
program. When an exception occurs program execution gets terminated.
In such cases we get a system generated error message. The good
thing about exceptions is that they can be handled in Java. By handling
the exceptions we can provide a meaningful message to the user about
the issue rather than a system generated message, which may not be
understandable to a user.
Exception Handling
If an exception occurs, which has not been handled by programmer then
program execution gets terminated and a system generated error
message is shown to the user. For example look at the system
generated exception below:
An exception generated by the system is given below