{"showinfowithstatuss":0,"info":"\u79fb\u52a8\u7535\u8bdd\u683c\

第三届&关爱女生&之&关爱嘉年华义修站&预约上门维...doc下载_爱问共享资料
第三届&关爱女生&之&关爱嘉年华义修站&预约上门维&#…
第三届&关爱女生&之&关爱嘉年华义修站&预约上门维....doc
第三届&关爱女生&之&关爱嘉年华…
简介:本文档为《第三届&关爱女生&之&关爱嘉年华义修站&预约上门维...doc》,可适用于综合领域,主题内容包含第三届"关爱女生"之"关爱嘉年华义修站"预约上门维第三届“关爱女生”之“关爱嘉年华义修站”预约上门维修申请表(南校区)填写表格前请阅读预约须知谢谢合符等。
侵权或盗版
*若权利人发现爱问平台上用户上传内容侵犯了其作品的信息网络传播权等合法权益时,请按照平台要求书面通知爱问!
赌博犯罪类
在此可输入您对该资料的评论~
添加成功至
资料评价:推荐这篇日记的豆列
&&&&&&&&&&&&{&Attachments&:[{&__type&:&ItemIdAttachment:#Exchange&,&Item by Holden Hoggard on Prezi通过api与CMS的内容创作和管理系统进行交互通过api与CMS的内容创作和管理系统进行交互爱前端百家号在本文中,我们将讨论组织如何通过api与CMS的内容创作和管理系统进行交互。Crafter CMS是一个分离的CMS,由多个微服务组成,内容创作和内容传递功能和服务被分离到各自不同的子系统中。组织通常希望通过api与内容创作和管理系统交互。在本文中,我们将展示与此API交互的基础:身份验证。获取管理下的项目列表。为一个项目写内容。为了保持真正的基础,我们将使用CURL,这是一种常见的Linux命令工具。您可以在这里找到Crafter CMS版本3.0的完整Crafter Studio API。步骤1:身份验证我们将使用身份验证API。curl -d '{&username&:&admin&,&password&:&admin&}' --cookie &XSRF-TOKEN=A_VALUE& --header &X-XSRF-TOKEN:A_VALUE& --header &Content-Type: application/json& -v -X POST http://localhost:8080/studio/api/1/services/api/1/security/login.json首先要注意的是,我们将执行一个POST,将用户名和密码作为JSON对象传递。在生产环境中,您需要使用HTTPS。接下来,您将注意到我们正在传递一个cookie“xsrf令牌”和一个标题“X-XSRF-TOKEN”。传递给这些值的值是任意的。它们必须匹配,并且必须在所有未来的PUT和POST API调用中传递。这些是用来防止某些跨浏览器脚本攻击的。如果您使用Studio api作为web客户机的一部分,您希望确保这些值是随机生成的。When you issue the curl command you will get back a response:* Trying ::1...* Trying 127.0.0.1...* Connected to localhost (127.0.0.1) port 8080 (#0)& POST /studio/api/1/services/api/1/security/login.json HTTP/1.1& Host: localhost:8080& User-Agent: curl/7.43.0& Accept: */*& Cookie: XSRF-TOKEN=A_VALUE& X-XSRF-TOKEN:A_VALUE& Content-Type: application/json& Content-Length: 39&* upload completely sent off: 39 out of 39 bytes& HTTP/1.1 200& Cache-Control: no-cache, no-store, max-age=0, must-revalidate& Pragma: no-cache& Expires: 0& Set-Cookie: JSESSIONID=2EF3EE44ADC04B578A3BE8F; Path=/ HttpOnly& Content-Type: application/charset=UTF-8& Content-Language: en-US& Transfer-Encoding: chunked& Date: Mon, 22 Jan :48 GMT&* Connection #0 to host localhost left intact{&username&:&admin&,&first_name&:&admin&,&last_name&:&admin&,&email&:&&}注意,返回的响应是一个成功的200状态代码,响应包含了对经过身份验证的用户的详细信息。还发现作为请求的一部分是JSESSION cookie。您将需要此值用于所有将来的请求。步骤2:获取用户授权使用的站点列表http://docs.craftercms.org/en/3.0/developers/projects/studio/api/site/get-sites-per-user.html curl --cookie &XSRF-TOKEN=A_VALUE;JSESSIONID=2EF3EE44ADC04B578A3BE8F& -H &X-XSRF-TOKEN:A_VALUE&
-X GET http://localhost:8080/studio/api/1/services/api/1/site/get-per-user.json?username=adminNote the CURL command contains your session ID and XSRF tokens.When you issue the CURL you will get a response that contains sites your user has access to:{&sites&:[{&id&:9,&siteId&:&ar&,&name&:&ar&,&description&:&&,&status&:null,&liveUrl&:null,&lastCommitId&:&cce9f110dab37fed7&,&publishingEnabled&:1,&publishingStatusMessage&:&idle|Idle&,&lastVerifiedGitlogCommitId&:null},{&id&:5,&siteId&:&diiot&,&name&:&diiot&,&description&:&&,&status&:null,&liveUrl&:null,&lastCommitId&:&92d543eaa164b1ebfbdd6ce538ae028d4d6421b7&,&publishingEnabled&:0,&publishingStatusMessage&:&idle|Idle&,&lastVerifiedGitlogCommitId&:&92d543eaa164b1ebfbdd6ce538ae028d4d6421b7&},{&id&:10,&siteId&:&editorialcom&,&name&:&editorialcom&,&description&:&&,&status&:null,&liveUrl&:null,&lastCommitId&:&503d922f226e8abef5a229f&,&publishingEnabled&:1,&publishingStatusMessage&:&&,&lastVerifiedGitlogCommitId&:&503d922f226e8abef5a229f&},{&id&:3,&siteId&:&flow&,&name&:&flow&,&description&:&&,&status&:null,&liveUrl&:null,&lastCommitId&:&a1fc778a364dbb4928a5&,&publishingEnabled&:1,&publishingStatusMessage&:&idle|Idle&,&lastVerifiedGitlogCommitId&:&a1fc778a364dbb4928a5&},{&id&:8,&siteId&:&vr&,&name&:&vr&,&description&:&&,&status&:null,&liveUrl&:null,&lastCommitId&:&c67fd9dd25d1aa59ff13e3fda2a4387be50dfc69&,&publishingEnabled&:1,&publishingStatusMessage&:&idle|Idle&,&lastVerifiedGitlogCommitId&:null}],&total&:6}上面的响应包含许多项目。在下一个调用中,我想将一个内容对象写入一个项目(editorial.com)。为此,我需要站点ID。我从上面的响应中得到这个:editorialcom。步骤3:将内容写入Editorialcom项目http://docs.craftercms.org/en/3.0/developers/projects/studio/api/content/write-content.htmlcurl -d &&page&&content-type&/page/category-landing&/content-type&&display-template&/templates/web/pages/category-landing.ftl&/display-template&&merge-strategy&inherit-levels&/merge-strategy&&file-name&index.xml&/file-name&&folder-name&test3&/folder-name&&internal-name&test3&/internal-name&&disabled &false&/disabled&&/page&& --cookie &XSRF-TOKEN=A_VALUE;JSESSIONID=2EF3EE44ADC04B578A3BE8F& -H &X-XSRF-TOKEN:A_VALUE&
-X POST &http://localhost:8080/studio/api/1/services/api/1/content/write-content.json?site=editorialcom&phase=onSave&path=/site/website/test3/index.xml&fileName=index.xml&user=admin&contentType=/page/category-landing&unlock=true&在上述电话中,请注意:我们将内容作为文章的正文。内容是XML格式的。在Crafter中,内容对象被存储为简单的XML文档。我们正在传递会话ID和XSRF令牌。我们正在传递一些参数,这些参数告诉Crafter CMS在何处以及如何将内容存储到存储库中。结论在本文中,我们介绍了连接到Crafter Studio的基本机制,以及Crafter CMS的编写服务。我们避免了每个API调用的细节,而支持宏观力学。您现在有了与这里找到的任何Crafter Studio API交互的基本技能和能力。走出去,融入社会!本文仅代表作者观点,不代表百度立场。系作者授权百家号发表,未经许可不得转载。爱前端百家号最近更新:简介:技术交流、资源共享,是程序员的网上乐园。作者最新文章相关文章

我要回帖

更多关于 redis info status 的文章

 

随机推荐