Archive for the ‘HTTP’ Category

Ajax Mistakes

January 11, 2006

If you haven’t read it here it is Ajax Mistakes

The important point, that we MUST take note.

When calling for a Document, Page, etc. Its best to use a URL (A unique Identifier for that document). Its the way the web is structured. Try using Apache’s mod_rewrite to make the URL readable. DO NOT FETCH SUCH DOCUMENTS WITH AJAX.

(more…)

Sessions

January 10, 2006

“Session” as the term suggests is time-period when the client is interacting with the server.

HTTP however is a stateless protocol. i.e. Every request that goes to the Server is treated as a new request from a new client. So to glue the sessions funda with HTTP, the Scripting languages have to come up with something with which it can track the clients.

(more…)

Multiple Domain Logins

January 9, 2006

Wonder how your login to mail.yahoo.com makes you logged into my.yahoo.com ?
It’s game of give and take with cookies.

(more…)

RSS Feeds

January 1, 2006

What on earth is this RSS ? Rational Security Service ? what is it ? That was a question that I had around a year back or so. But now its clear.

RSS is nothing but standard XML data. But what does it stand for ? RSS stands for Really Simple Syndication, which came from a structure of defining a resource. RSS was defined so that the user, client can read any resource available without browsing the particular site. Be it news website, a blog site, a technical resource site, etc. The idea was to syndicate or deliver the content in other manner than the web page.

And then comes the “baaap” (Father) of data structuring format, XML
You may have come across something like this

RSS Feed icon in Firefox 1.5

The orange icon in Firefox notifies that the current website has an RSS feed, or the user can alternatively fetch the content from RSS feed.

(more…)

Cookies

December 30, 2005

Cookie is probably one of the most interesting development for the HTTP.
Cookies are small text files generally not larger than 8 kbs (I’m still exaggerating). These NOT downloaded from the web. They are saved by the Browser (yes the browser, your own client). The cookie is saved when server directs the browser.

The Server sends a response header of Set-Cookie

Set-Cookie: favColor=blue; expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=example.com

(more…)

Conditional GET Request

December 27, 2005

The HTTP Protocol defines a caching mechanism, in which the proxy web-servers can cache pages, files, images etc. Since caching is in place, There is a method which the servers are asked to return the document, either the “cached” or “live” document.

This request of asking the server for a document considering a specific parameter is called a Conditional GET Request. In this request, a specific request header is sent If-Modified-Since. This header sends a RFC 2822 formatted date as the value. The proxy which is between the Server and the client checks the date, and the cached document, if the condition matches, A 304 Not Modified header is sent back to the client in the response.

(more…)

HTTP POST Request

December 25, 2005

Many of you must be aware that a “form” element in HTML has a method attribute, most of you set it to either GET or POST. In my previous post, I explained what is a simple GET request. This time… Its POST’s turn.

There is a common knowledge, that if you want to hide the data that is submitted, you use POST. But is it that the data is really hidden? The browser is a client and the client MUST send the data to the server, in a GET request the data is sent in a query string.

Consider you have a form with two elements “name” and “sex”. Consider the first scenario where the form’s method attribute is set to GET.

form .. method=”GET” .. action=”/somepage.php”

When the user submits the data, the name-value pairs of the form elements are url-encoded and transmitted in the URL as..

/somepage.php?name=ruturajv&sex=m

(more…)

HTTP GET Request

December 24, 2005

My first post here would be what is an HTTP Request.

When you fetch a page by typing the URL in the browser, The browser connects to the Host on port 80. Let us take an example, You type http://example.com/index.html and press enter

The browser first parses the URL and makes a Socket connection to example.com on port 80. The browser also parses the requested Resource or the page that is /index.html

The browser then writes the following to the socket

GET /index.html HTTP/1.1
Host: example.com

The request is completed when the last charecters are \r\n\r\n

(more…)


Follow

Get every new post delivered to your Inbox.