????????????????????е?Web????????????H5??????????HTTP????Web???????????????????????????????÷???Json?????????JS???????????????Json????H5??涯??????????????????ajax????????????????£???GET/POST??HTTP????????????????????????????json??xml????????????????????HTTP??????????????Web??ú?H5???????????????????????
????????????HTTP?????????????????????HTTP??????????
???????????????????????????????????
?????????json??
????HTTP???????????????
????1??http?????
????1????HTTPЭ???URL
????HTTP???????????Э?飩????????????????????????????????ò??Э?飬??????TCP??????????HTTP1.1?汾?и???????????????????????????Web???????????????HTTPЭ??????Web??á?
????HTTP URL (URL??????????????URI??????????????????????????????)???????£?http://host[:port][abs_path]??????http???????HTTPЭ??????λ?????????host????????Internet????????????IP?????port????????????????????????80??abs_path????????????URI?????URL????и???abs_path????????????????URI?????????“/”?????????????????????????????????????ɡ?
????eg.: a??????www.guet.edu.cn ??????????????http://www.guet.edu.cn/
????b??http://192.168.0.116:8080/index.jsp
????2)??HTTPЭ???????
????http???????????????????????????С?????????????????.
???????????????????????????????????????????????URI??Э???汾????????£?Method Request-URI HTTP-Version CRLF?????? Method???????????Request-URI?????????????????         HTTP-Version????????HTTPЭ??汾??CRLF??????????У??????????β??CRLF????????????????CR??LF??????????????????з???????д???ж????????????????????£?
????GET????????Request-URI????????????
????POST????Request-URI???????????????μ??????
????HEAD??????????Request-URI???????????????????????
????PUT????????????洢????????????Request-URI?????????
????DELETE??????????????Request-URI????????????
????TRACE????????????????????????????????????????????
????OPTIONS????????????????????????????????????????????????
????PATCH??????а???????????????????URI?????????????????
????MOVE??????????????????????????????????????
????COPY????????????????????濽?????????????????
????LINK???????????????????????
????UNLINK?????????????
????WRAPPED?????????????????????????
????Extension-mothed????????Э???????£?????????????????
????3)??HTTPЭ??????
???????????????????????????????????HTTP????????HTTP?????????????????????????????С?????????????????
????a?????и?????£?HTTP-Version Status-Code Reason-Phrase CRLF???У?HTTP-Version?????????HTTPЭ???汾??Status-Code???????????????????????Reason-Phrase?????????????????????????????λ?????????????????????????????????????????????
????1xx???????–??????????????????????
????2xx?????–??????????????????????????
????3xx???????–?????????????и?????????????
????4xx??????????–????????????????????????
????5xx?????????????–??????δ?????????????
????b???????????????????????????????
????2??JSON
????JSON??JavascriptObjectNotation???????????????????????????????????????????????????????JSON?????????????
????1)??”????/?”???????A collection of name/value pairs??????????????У?????????????object?????????record????????struct???????dictionary??????????hash table?????м??б??keyed list??????????????饗associative array????
????2????????????б??An ordered list of values??????????????У????????????饗array????
????eg.??
????a????????? / ???
????{ "firstName": "Brett" }
????b?????????
????{ "people": [
????{ "firstName": "Brett"?? "lastName":"McLaughlin"?? "email": "aaaa" }??
????{ "firstName": "Jason"?? "lastName":"Hunter"?? "email": "bbbb"}??
????{ "firstName": "Elliotte"?? "lastName":"Harold"?? "email": "cccc" }
????]}
??????????????
????1?????Python?????????????
????2??????http??????pycurl??飻
????3????????????????????????????????????
????4???????в?????e?????????????????????????json??????????????????????json???????????????????????????????????????????????????????????β???????????????????β?????????飩
????5??????????????????????????????????????????????????????????????????????????test suite??
????6?????HTMLTestRunner?????????????
??????????????
???????????2????????
????1??????????
????1)????????????-?г???????????

????2?????????????-??????????????

????2????д????????
????1?????г????????

?????????get????