Friday, August 22, 2014

HTTP (Hypertext Transfer Protocol)

HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files (text, graphic images, sound, video, and other multimedia files) on the World Wide Web.

Web browser is an HTTP client, sending requests to server machines. As soon as a Web user opens their Web browser, the user is indirectly making use of HTTP. When we browse a web site using any browser (say Internet Explorer, Google Chrome, Mozilla Firefox etc.), all our actions produces HTTP requests; which are sent to the web server. Web Server replies to each of these requests. The browser uses these server responses/replies to build each page that web user see in its browser window. Some of the responses contain page text in form of HTML code, some contain images that we see on the page, and some carry additional data that is also used to display the page correctly.

Each HTTP request consists of 3 sections: request, header and body.

HTTP Methods

Two commonly used HTTP methods are GET and POST.
·      A GET-request is used to download a resource (page, image, etc.) from the server. GET-method requests data from a specified resource.
·      POST-requests are used to pass some data to the server. They can contain form data, a file that needs to be uploaded, etc. The POST-method submits data to be processed to a specified resource.

Both GET and POST requests can contain parameters. Each parameter has a name and a value; different ones are separated by “&”.

For GET-requests parameters are passed inside the URI after the “?” sign.
GET URL example:
http://my_uri/page.aspx?parameter_name1=value1&parameter_name2=value2 

If POST method is used, parameters are passed inside the request body.

VS Code # Warning - npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead

Error : VS Code - NPM Warning - npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead Solution:  Foll...