codecamp

CherryPy HTTP方法

对资源进行操作的HTTP方法列表如下 -

S.NoHTTP方法和操作
1.

HEAD

检索资源元数据。

2.

GET

检索资源元数据和内容。

3.

POST

请求服务器使用请求正文中包含的数据创建新资源。

4.

PUT

请求服务器将现有资源替换为请求正文中包含的资源。

5.

DELETE

请求服务器删除该URI标识的资源。

6.

OPTIONS

请求服务器全局或特定地向资源返回有关功能的详细信息。


CherryPy REST接口通过CherryPy
CherryPy Atom Publishing Protocol (APP)
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

CherryPy 一个工作应用程序

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }