11package apijson .demo .server ;
22
3+ import static zuo .biao .apijson .RequestMethod .DELETE ;
34import static zuo .biao .apijson .RequestMethod .GET ;
5+ import static zuo .biao .apijson .RequestMethod .GETS ;
6+ import static zuo .biao .apijson .RequestMethod .HEAD ;
7+ import static zuo .biao .apijson .RequestMethod .HEADS ;
8+ import static zuo .biao .apijson .RequestMethod .POST ;
9+ import static zuo .biao .apijson .RequestMethod .PUT ;
410
511import com .jfinal .kit .HttpKit ;
612
@@ -33,7 +39,7 @@ public void get() {
3339 * @see {@link RequestMethod#HEAD}
3440 */
3541 public void head () {
36- renderJson (new DemoParser (GET ).setSession (getSession ()).parse (HttpKit .readData (getRequest ())));
42+ renderJson (new DemoParser (HEAD ).setSession (getSession ()).parse (HttpKit .readData (getRequest ())));
3743 }
3844
3945 /**限制性GET,request和response都非明文,浏览器看不到,用于对安全性要求高的GET请求
@@ -43,7 +49,7 @@ public void head() {
4349 * @see {@link RequestMethod#GETS}
4450 */
4551 public void gets () {
46- renderJson (new DemoParser (GET ).setSession (getSession ()).parse (HttpKit .readData (getRequest ())));
52+ renderJson (new DemoParser (GETS ).setSession (getSession ()).parse (HttpKit .readData (getRequest ())));
4753 }
4854
4955 /**限制性HEAD,request和response都非明文,浏览器看不到,用于对安全性要求高的HEAD请求
@@ -53,7 +59,7 @@ public void gets() {
5359 * @see {@link RequestMethod#HEADS}
5460 */
5561 public void heads () {
56- renderJson (new DemoParser (GET ).setSession (getSession ()).parse (HttpKit .readData (getRequest ())));
62+ renderJson (new DemoParser (HEADS ).setSession (getSession ()).parse (HttpKit .readData (getRequest ())));
5763 }
5864
5965 /**新增
@@ -63,7 +69,7 @@ public void heads() {
6369 * @see {@link RequestMethod#POST}
6470 */
6571 public void post () {
66- renderJson (new DemoParser (GET ).setSession (getSession ()).parse (HttpKit .readData (getRequest ())));
72+ renderJson (new DemoParser (POST ).setSession (getSession ()).parse (HttpKit .readData (getRequest ())));
6773 }
6874
6975 /**修改
@@ -73,7 +79,7 @@ public void post() {
7379 * @see {@link RequestMethod#PUT}
7480 */
7581 public void put () {
76- renderJson (new DemoParser (GET ).setSession (getSession ()).parse (HttpKit .readData (getRequest ())));
82+ renderJson (new DemoParser (PUT ).setSession (getSession ()).parse (HttpKit .readData (getRequest ())));
7783 }
7884
7985 /**删除
@@ -83,7 +89,7 @@ public void put() {
8389 * @see {@link RequestMethod#DELETE}
8490 */
8591 public void delete () {
86- renderJson (new DemoParser (GET ).setSession (getSession ()).parse (HttpKit .readData (getRequest ())));
92+ renderJson (new DemoParser (DELETE ).setSession (getSession ()).parse (HttpKit .readData (getRequest ())));
8793 }
8894
8995
0 commit comments