HTTP Methods and XHTML

 

HTTP Methods:


  • We need different HTTPS methods(like GET, POST, PUT, DELETE etc) so that all the developers will use the common naming convention for CRUD operations.
  • Explanation World Wide Web(WWW) is distributed in 2 sections, one is client and the other is server. 
  • Let's say I have created an API and for reading data I will tell CLIENT to use the READ method, and same the way some other developer has created the API used SEARCH to get the data from the server, then there will be a lot of confusion in the World Wide Web, although READ & SEARCH both are doing the same operation (fetching the data from the server).
  • Every developer will get confused with all these different naming conventions for the same operation in the server. 
  • The HTTP protocol is used to send information in a format that both the client and the server can understand.


 

GET:  GET is used to request data from a specified resource.
POST:  POST is used to send data to a server to create/update a resource.
PUT:  PUT is used to send data to a server to create/update a resource.
HEAD:  HEAD is almost identical to GET, but without the response body.
DELETE: The DELETE method deletes the specified resource.
PATCH:  The PATCH method is used to apply partial modifications to a resource.
OPTIONS:  The OPTIONS method describes the communication options for the target resource.
CONNECT: The CONNECT method is used to start a two-way communications (a tunnel) with the requested resource.
TRACE: The TRACE method is used to perform a message loop-back test that tests the path for the target resource.


What is XHTML?

  • XHTML stands for EXtensible HyperText Markup Language
  • XHTML is a stricter, more XML-based version of HTML
  • XHTML is HTML defined as an XML application
  • XHTML is supported by all major browsers

Why XHTML?

XML is a markup language where all documents must be marked up correctly (be "well-formed").

XHTML was developed to make HTML more extensible and flexible to work with other data formats (such as XML). In addition, browsers ignore errors in HTML pages, and try to display the website even if it has some errors in the markup. So XHTML comes with a much stricter error handling.


The Most Important Differences from HTML

  • <!DOCTYPE> is mandatory
  • The xmlns attribute in <html> is mandatory
  • <html>, <head>, <title>, and <body> are mandatory
  • Elements must always be properly nested
  • Elements must always be closed

  • Elements must always be in lowercase
  • Attribute names must always be in lowercase
  • Attribute values must always be quoted
  • Attribute minimization is forbidden

 

Comments

Popular Posts