Those parameters can be transmitted using the GET method or the
POST method (there are also some other less common methods). The first appends the parameters to the
address while the second uses the headers of the request to store them. The syntax to append parameters
using GET is the following:
http://www.example.com/page.n?param1=value1 & param2=value2
??‘
??‘
??‘
??‘
228
Part II: Server Side, JavaScript, and Flash; Oh My!
The param1 is a variable name while value1 is its value. The parameters are separated from the address
part by a question mark symbol and between them by the ampersand symbol ( & ). Each key - value pair is
composed by the variable name, the equal symbol ( = ) and the value. Because the HTTP restricts the use
of some characters in the URI, values and parameters must be encoded.
While the GET method is implicitly used for every standard hyperlink on a page, to use the POST
method it is necessary to recur to a form submission specifying the desired method. Another common
way to make POST requests is to use an XHR (XML HTTP Request) call that is the very base of AJAX
(Asynchronous JavaScript and XML) applications.
Pages:
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448