1.GET请æ±çæ°æ®ä¼éå¨URLä¹åï¼å°±æ¯ææ°æ®æ¾ç½®å¨HTTPå议头ä¸ï¼ï¼ä»¥?åå²URLåä¼ è¾æ°æ®ï¼åæ°ä¹é´ä»¥&ç¸è¿ï¼å¦ï¼
www.google.com/webhp?hl=zh-cn å¦ææ°æ®æ¯è±æåæ¯/æ°åï¼åæ ·åéï¼å¦ææ¯ç©ºæ ¼ï¼è½¬æ¢ä¸º+ï¼å¦ææ¯ä¸æ/å
¶ä»å符ï¼åç´æ¥æå符串ç¨BASE64å å¯ï¼å¾åºå¦ï¼%E4%BD%A0%E5%A5%BDï¼å
¶ä¸ï¼
XXä¸çXX为该符å·ä»¥16è¿å¶è¡¨ç¤ºçASCIIã
POSTææ交çæ°æ®åæ¾ç½®å¨æ¯HTTPå
çå
ä½ä¸ã
2."GETæ¹å¼æ交çæ°æ®æå¤åªè½æ¯1024åèï¼ç论ä¸POST没æéå¶ï¼å¯ä¼ è¾å¤§éçæ°æ®ï¼IIS4ä¸æ大为80KBï¼IIS5ä¸ä¸º100KB"
以ä¸è¿å¥æ¯æä»å
¶ä»æç« è½¬è¿æ¥çï¼å
¶å®è¿æ ·è¯´æ¯é误çï¼ä¸åç¡®çï¼
(1).é¦å
æ¯"GETæ¹å¼æ交çæ°æ®æå¤åªè½æ¯1024åè"ï¼å 为GETæ¯éè¿URLæ交æ°æ®ï¼é£ä¹GETå¯æ交çæ°æ®éå°±è·URLçé¿åº¦æç´æ¥å
³ç³»äºãèå®é
ä¸ï¼URLä¸åå¨åæ°ä¸éçé®é¢ï¼HTTPåè®®è§è没æ对URLé¿åº¦è¿è¡éå¶ãè¿ä¸ªéå¶æ¯ç¹å®çæµè§å¨åæå¡å¨å¯¹å®çéå¶ãIE对URLé¿åº¦çéå¶æ¯2083åè(2K+35)ã对äºå
¶ä»æµè§å¨ï¼å¦NetscapeãFireFoxçï¼ç论ä¸æ²¡æé¿åº¦éå¶ï¼å
¶éå¶åå³äºæä½ç³»ç»çæ¯æã
注æè¿æ¯éå¶æ¯æ´ä¸ªURLé¿åº¦ï¼èä¸ä»
ä»
æ¯ä½ çåæ°å¼æ°æ®é¿åº¦ã[è§åèèµæ5]
(2).ç论ä¸è®²ï¼POSTæ¯æ²¡æ大å°éå¶çï¼HTTPåè®®è§èä¹æ²¡æè¿è¡å¤§å°éå¶ï¼è¯´âPOSTæ°æ®éåå¨80K/100Kç大å°éå¶âæ¯ä¸åç¡®çï¼POSTæ°æ®æ¯æ²¡æéå¶çï¼èµ·éå¶ä½ç¨çæ¯æå¡å¨çå¤çç¨åºçå¤çè½åã
对äºASPç¨åºï¼Request对象å¤çæ¯ä¸ªè¡¨ååæ¶åå¨100Kçæ°æ®é¿åº¦éå¶ãä½å¦æ使ç¨Request.BinaryReadå没æè¿ä¸ªéå¶ã
ç±è¿ä¸ªå»¶ä¼¸åºå»ï¼å¯¹äºIIS 6.0ï¼å¾®è½¯åºäºå®å
¨èèï¼å 大äºéå¶ãæ们è¿éè¦æ³¨æï¼
1).IIS 6.0é»è®¤ASP POSTæ°æ®éæ大为200KBï¼æ¯ä¸ªè¡¨ååéå¶æ¯100KBã
2).IIS 6.0é»è®¤ä¸ä¼ æ件çæ大大å°æ¯4MBã
3).IIS 6.0é»è®¤æ大请æ±å¤´æ¯16KBã
IIS 6.0ä¹å没æè¿äºéå¶ã[è§åèèµæ5]
æ以ä¸é¢ç80Kï¼100Kå¯è½åªæ¯é»è®¤å¼èå·²(注ï¼å
³äºIIS4åIIS5çåæ°ï¼æè¿æ²¡æ确认)ï¼ä½è¯å®æ¯å¯ä»¥èªå·±è®¾ç½®çãç±äºæ¯ä¸ªçæ¬çIIS对è¿äºåæ°çé»è®¤å¼é½ä¸ä¸æ ·ï¼å
·ä½è¯·åèç¸å
³çIISé
ç½®ææ¡£ã
3.å¨ASPä¸ï¼æå¡ç«¯è·åGET请æ±åæ°ç¨Request.QueryStringï¼è·åPOST请æ±åæ°ç¨Request.Formãå¨JSPä¸ï¼ç¨request.getParameter(\"XXXX\")æ¥è·åï¼è½ç¶jspä¸ä¹ærequest.getQueryString()æ¹æ³ï¼ä½ä½¿ç¨èµ·æ¥æ¯è¾éº»ç¦ï¼æ¯å¦ï¼ä¼ ä¸ä¸ªtest.jsp?name=hyddd&password=hydddï¼ç¨request.getQueryString()å¾å°çæ¯ï¼name=hyddd&password=hydddãå¨PHPä¸ï¼å¯ä»¥ç¨$_GETå$_POSTåå«è·åGETåPOSTä¸çæ°æ®ï¼è$_REQUESTåå¯ä»¥è·åGETåPOST两ç§è¯·æ±ä¸çæ°æ®ãå¼å¾æ³¨æçæ¯ï¼JSPä¸ä½¿ç¨requeståPHPä¸ä½¿ç¨$_REQUESTé½ä¼æéæ£ï¼è¿ä¸ªä¸æ¬¡åå个æç« æ»ç»ã
4.POSTçå®å
¨æ§è¦æ¯GETçå®å
¨æ§é«ã注æï¼è¿éæ说çå®å
¨æ§åä¸é¢GETæå°çâå®å
¨âä¸æ¯å个æ¦å¿µãä¸é¢âå®å
¨âçå«ä¹ä»
ä»
æ¯ä¸ä½æ°æ®ä¿®æ¹ï¼èè¿éå®å
¨çå«ä¹æ¯çæ£çSecurityçå«ä¹ï¼æ¯å¦ï¼éè¿GETæ交æ°æ®ï¼ç¨æ·ååå¯ç å°ææåºç°å¨URLä¸ï¼å 为(1)ç»å½é¡µé¢æå¯è½è¢«æµè§å¨ç¼åï¼(2)å
¶ä»äººæ¥çæµè§å¨çåå²çºªå½ï¼é£ä¹å«äººå°±å¯ä»¥æ¿å°ä½ çè´¦å·åå¯ç äºï¼é¤æ¤ä¹å¤ï¼ä½¿ç¨GETæ交æ°æ®è¿å¯è½ä¼é æCross-site
request forgeryæ»å»ã
æ»ç»ä¸ä¸ï¼Getæ¯åæå¡å¨åç´¢åæ°æ®çä¸ç§è¯·æ±ï¼èPostæ¯åæå¡å¨æ交æ°æ®çä¸ç§è¯·æ±ï¼å¨FORMï¼è¡¨åï¼ä¸ï¼Methodé»è®¤ä¸º"GET"ï¼å®è´¨ä¸ï¼GETåPOSTåªæ¯åéæºå¶ä¸åï¼å¹¶ä¸æ¯ä¸ä¸ªåä¸ä¸ªå.