MediaWiki API 帮助
这是自动生成的MediaWiki API文档页面。
文档和例子:https://www.mediawiki.org/wiki/API:Main_page/zh
action=changecontentmodel
(main | changecontentmodel)
- 此模块需要读取权限。
- 此模块需要写入权限。
- 此模块只允许POST请求。
- 来源:MediaWiki
- 许可协议:GPL-2.0-or-later
变更页面的内容模型
参数:
- title
- Title of the page to change the contentmodel of. Cannot be used together with pageid. 
- pageid
- Page ID of the page to change the contentmodel of. Cannot be used together with title. 
- Type: integer
- summary
- Edit summary and log entry reason 
- tags
- Change tags to apply to the log entry and edit. 
- 值(以|或替代物分隔):
- model
- Content model of the new content. 
- This parameter is required.
- 以下值中的一个:css、javascript、json、markdown、text、wikitext
- bot
- Mark the content model change with a bot flag. 
- Type: boolean (details)
- token
- 从action=query&meta=tokens取回的“csrf”令牌 
- This parameter is required.
例子:
- Change the main page to have the textcontent model
- api.php?action=changecontentmodel&title=Main Page&model=text&token=123ABC [在沙盒中打开]