unresolved_external
unresolved_external

Reputation: 2018

What happening when typing in the browser URL?

I've been asked this question several times on interview and each time could not give clear answer. So my question is, what is happening when we are typing URL in browser I know that this URL is translated into IP via DNS and it is obtained via GET method. But what is happening in details? Could someone please tell me?

Upvotes: 0

Views: 142

Answers (1)

Nick Libreman
Nick Libreman

Reputation: 513

The URL has several parts that mean different things, you can read up on it when you search for "parts of URL" for example.

Essentially when you have a URL like:

http://server.domain.com/path/to/script.php?var=value&var2=value2

then http is the protocol used for the transfer (this can be http, https, ftp or other), server.domain.com is the DNS of the server to be contacted (which is resolved using DNS) which is itself composed of parts (com is the 1st level domain, domain is 2nd and server is 3rd - read up on DNS resolution to understand more)

the part "/path/to/script.php?var=value&var2=value2" is handed to the server where: "/path/to/" is path to the document/script being called "script.php" is the name of the script and "?var=value&var2=value2" are the parameters handed to the script: var is going to have the value of "value" and var2 of "value2"

and that's the whole process :)

Upvotes: 1

Related Questions