HTTP要求方法

來源:互聯網
上載者:User

HTTP不僅僅只有POST和GET兩種方法,還有OPTIONS, DELETE, HEAD, PUT, TRACE, CONNECT等方法,

 

這裡有相關的介紹:

http://tinyliu.info/2011/01/get/

http://tinyliu.info/2011/01/post/

http://tinyliu.info/2011/01/put/

http://tinyliu.info/2011/01/head/

http://tinyliu.info/2011/01/options/

 

 

對於HTTP的請求操作,還有等冪方法的這一個說法,所謂等冪是指不管進行多少次操作,結果都一樣。PUT,GET,DELETE都是等冪的,POST不是。

 

詳情請查看此處

 

http://macrochen.iteye.com/blog/678683

 

 

 

一般在REST方法中,採用的是GET, PUT, DELETE, POST四種方法。

 

 

在Tornado中,預留提供了

 

    def get(self, *args, **kwargs):        raise HTTPError(405)    def post(self, *args, **kwargs):        raise HTTPError(405)    def delete(self, *args, **kwargs):        raise HTTPError(405)    def put(self, *args, **kwargs):        raise HTTPError(405)

 

所以上述四種方法都是支援的。

 

 

因此在CRUD操作中,一般用post來增加一個新的內容,用PUT來更新內容,delete和get就無需多說了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.