{"id":1542,"date":"2006-11-26T23:37:17","date_gmt":"2006-11-26T15:37:17","guid":{"rendered":"http:\/\/ihower.idv.tw\/blog\/archives\/1542"},"modified":"2011-04-09T02:13:05","modified_gmt":"2011-04-08T18:13:05","slug":"rest-and-restful","status":"publish","type":"post","link":"https:\/\/ihower.tw\/blog\/1542-rest-and-restful","title":{"rendered":"\u4ec0\u9ebc\u662fREST\u8ddfRESTful?"},"content":{"rendered":"<p>Update(2008\/5): \u4e8b\u9694\u4e00\u5e74\u591a\uff0c\u6211\u5c0d\u65bc Rails \u5982\u4f55\u61c9\u7528 RESTful \u9019\u500b\u6982\u5ff5\u6709\u5b8c\u5168\u4e0d\u540c\u7684\u5207\u5165\u89d2\u5ea6\uff0c\u8a73\u898b <a href=\"http:\/\/ihower.idv.tw\/blog\/archives\/1720\">Practical Rails2<\/a> \u6295\u5f71\u7247\u3002<\/p>\n<p>Ruby on Rails 1.2 \u7684\u4e00\u500b\u91cd\u8981\u9032\u5c55\u662f RESTful\uff0c\u5728\u4e86\u89e3\u600e\u9ebc\u7528\u4e4b\u524d\uff0c\u6211\u5011\u8981\u5148\u4e86\u89e3\u4ec0\u9ebc\u662f REST(Representational State Transfer)?<\/p>\n<p><strong>\u4ec0\u9ebc\u662fREST?<\/strong><\/p>\n<p>REST \u662f\u4e00\u7a2e\u5206\u6563\u5f0f<a href=\"http:\/\/en.wikipedia.org\/wiki\/Hypermedia\">\u8d85\u5a92\u9ad4<\/a>\u7cfb\u7d71(\u5982WWW)\u7684\u8edf\u9ad4\u67b6\u69cb\u98a8\u683c\uff0c\u4f60\u53ef\u4ee5\u60f3\u50cf\u5b83\u662f\u4e00\u500b\u826f\u597d\u8a2d\u8a08\u7684Web\u61c9\u7528\u7a0b\u5f0f\u898f\u5247: \u4e00\u7d44\u7db2\u8defWeb\u9801\u9762(\u865b\u64ec\u7684\u72c0\u614b\u6a5f\u5668)\uff0c\u5176\u4e2d Client \u900f\u904e\u9ede\u9078\u8d85\u9023\u7d50(\u72c0\u614b\u8b8a\u63db)\uff0c\u7d50\u679c\u662f\u4e0b\u500bWeb\u9801\u9762(\u8868\u793a\u61c9\u7528\u7a0b\u5f0f\u7684\u4e0b\u4e00\u500b\u72c0\u614b)\u3002<\/p>\n<p>REST \u6240\u63cf\u8ff0\u7684\u7db2\u8def\u7cfb\u7d71\u5305\u62ec\u4e09\u500b\u90e8\u4efd:<\/p>\n<li>data elements (resource, resource identifier, representation)<\/li>\n<li>connectors (client, server, cache, resolver, tunnel)<\/li>\n<li>components (origin server, gateway, proxy, user agent)<\/li>\n<p>\u5e7e\u500b\u91cd\u9ede:<\/p>\n<li>Data elements \u7531\u6a19\u6e96\u5316\u4ecb\u9762\u5b58\u53d6<\/li>\n<li>Components \u900f\u904e\u4ecb\u9762\u50b3\u8f38 \u8cc7\u6e90\u8868\u5fb5\u00a0(representations of resources) \u4f86\u6e9d\u901a\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u64cd\u4f5c\u8cc7\u6e90\u672c\u8eab\u3002<\/li>\n<li>Connectors \u63d0\u4f9b component \u7684\u62bd\u8c61\u4ecb\u9762\u4f86\u6e9d\u901a\uff0c\u96b1\u85cf\u6e9d\u901a\u6a5f\u5236\u7684\u5be6\u4f5c\u7d30\u7bc0\u3002<\/li>\n<li>Components \u4f7f\u7528 connectors \u4f86\u5b58\u53d6\uff0cconnectors \u63d0\u4f9b\u8cc7\u6e90\u7684\u5b58\u53d6\u6216\u5c45\u4e2d\u3002<\/li>\n<li>\u6240\u6709\u4f86\u81ea connector \u7684 requests \u5fc5\u9808\u5305\u542b\u6240\u6709\u5fc5\u8981\u7684\u8cc7\u8a0a\u4f86\u4e86\u89e3\u8a72 request\uff0c\u4e0d\u9700\u8981\u4f9d\u9760\u4e4b\u524d\u7684request (\u5373 stateless)<!--more--><\/li>\n<p>\u56b4\u683c\u4f86\u8aaaREST\u7b26\u5408\u4ee5\u4e0b\u5e7e\u500b\u689d\u4ef6:<\/p>\n<li>\u61c9\u7528\u7a0b\u5f0f\u7684\u72c0\u614b\u8ddf\u529f\u80fd\u62c6\u6210 <strong>resources<\/strong><\/li>\n<li>\u6bcf\u500b resource \u4f7f\u7528\u7368\u4e00\u7121\u4e8c\u7528\u4f86\u7576\u4f5c\u8d85\u9023\u7d50\u7684\u901a\u7528\u5b9a\u4f4d\u8a9e\u6cd5(\u5728WWW\u4e2d\u5373URI)<\/li>\n<li>\u6240\u6709 resources \u5171\u7528\u4e00\u81f4\u7684\u4ecb\u9762\u5728 client \u8ddf resource \u4e4b\u9593\u8f49\u63db\u72c0\u614b\uff0c\u5305\u62ec:<\/li>\n<ul>\n<li>\u4e00\u7d44\u6709\u9650\u7684\u826f\u597d\u5b9a\u7fa9\u64cd\u4f5c <strong>well-defined operations<\/strong> (\u5728HTTP\u4e2d\u5373 GET\/POST\/PUT\/DELETE)<\/li>\n<li>\u4e00\u7d44\u6709\u9650\u7684\u5167\u5bb9\u683c\u5f0f <strong>content types<\/strong>,\u4e5f\u8a31\u5305\u62ec \u53ef\u57f7\u884c\u7684\u7a0b\u5f0f\u78bc <a href=\"http:\/\/en.wikipedia.org\/wiki\/Code_on_demand\"><strong>code-on-demand<\/strong><\/a>\u00a0(\u5728WWW\u4e2d\u5373Javascript)<\/li>\n<\/ul>\n<li>\u9019\u7a2e\u901a\u8a0a\u5354\u5b9a protocol (\u5728WWW\u4e2d\u5373\u7528HTTP) \u5305\u542b\u4ee5\u4e0b\u7279\u8272:\n<ul>\n<li><strong>\u4f7f\u7528\u8005\u7aef\/\u4f3a\u670d\u5668\u7aef Client\/Server<\/strong><\/li>\n<li><strong>\u72c0\u614b\u7121\u95dc Stateless<\/strong><\/li>\n<li><strong>\u53ef\u4ee5\u5feb\u53d6 Cacheable<\/strong><\/li>\n<li><strong>\u5206\u5c64\u7684 Layered<\/strong><\/li>\n<\/ul>\n<\/li>\n<p>\u7b26\u5408 REST principles \u7684\u7cfb\u7d71\u7a31\u505a RESTful\u3002\u00a0<\/p>\n<p>\u4e00\u822c\u4f86\u8aaaREST\u9019\u500b\u8a5e\u5f59\u5e38\u88ab\u7528\u4f86\u63cf\u8ff0\u4efb\u4f55\u4f7f\u7528XML (or YAML, JSON, plain text) \u7684\u7c21\u55ae\u4ecb\u9762\uff0c\u800c\u4e0d\u9808\u9760\u5176\u4ed6\u6a5f\u5236(\u5982SOAP)\u3002\u53e6\u5916 REST \u96d6\u7136\u662f\u500b\u4f86\u81ea WWW \u7684\u67b6\u69cb\u6982\u5ff5(\u6bd4WWW\u665a)\uff0c\u4f46\u662f\u9019\u5169\u8005\u4e26\u4e0d\u662f\u7d81\u5728\u4e00\u8d77\uff0c\u6709\u53ef\u80fd\u8a2d\u8a08\u4e00\u500b\u5927\u578b\u8edf\u9ad4\u7cfb\u7d71\u7b26\u5408REST\u4f46\u662f\u4e0d\u7528HTTP\u5354\u5b9a\u4e5f\u4e0d\u9700\u8ddfWWW\u4e92\u52d5\uff0c\u4e5f\u6709\u53ef\u80fd\u8a2d\u8a08\u4e00\u500b\u7c21\u55ae\u7684 XML+HTTP \u754c\u9762\u4f7f\u7528 RPC model \u800c\u4e0d\u7b26\u5408 REST principles\u3002<\/p>\n<p><strong>Resources<\/strong><\/p>\n<p>REST\u7684\u4e00\u500b\u6700\u91cd\u8981\u7684\u89c0\u5ff5\u5c31\u662f resources (\u7279\u5b9a\u8cc7\u8a0a\u7684\u8cc7\u6e90)\uff0c\u6bcf\u4e00\u500b resource \u7531\u4e00\u500b\u00a0global identifier (\u5373URI)\u6240\u8868\u793a\u3002\u70ba\u4e86\u64cd\u4f5c\u9019\u4e9b\u00a0 resources\uff0c\u7db2\u8def\u7684 components (\u5373 clients \u8ddfservers) \u900f\u904e\u6a19\u6e96\u5316\u7684\u4ecb\u9762 (\u5373HTTP) \u4f86\u6e9d\u901a\u4e26\u4ea4\u63db\u9019\u4e9b resources \u7684 representations (\u5373\u5be6\u969b\u4e0a\u50b3\u9054\u8cc7\u8a0a\u7684\u6587\u4ef6).<\/p>\n<p>\u4efb\u610f\u6578\u91cf\u7684\u00a0connectors (\u5982clients, servers, caches, tunnels\u7b49) \u53ef\u4ee5\u5c45\u4e2d request\uff0c\u4f46\u662f\u90fd\u4e0d\u53ef\u4ee5 &#8220;seeing past&#8221; (\u4e0d\u9700\u8981\u5176\u4ed6 layer\u5c64)\u3002\u9019\u6a23\u7684\u61c9\u7528\u7a0b\u5f0f\u8ddf\u4e00\u500b resource \u4e92\u52d5\u6839\u64da\u5169\u4ef6\u4e8b\u60c5<strong>: resource\u7684URI \u8ddf \u8981\u505a\u7684\u52d5\u4f5c\u00a0<\/strong> \u2013 \u5b83\u4e0d\u9700\u8981\u77e5\u9053\u662f\u5426\u6709\u00a0 caches, proxies, gateways, firewalls, tunnels, \u6216\u5176\u4ed6\u4efb\u4f55\u85cf\u5728sever\u4e4b\u9593\u7684\u6771\u897f\u3002\u9019\u500b\u61c9\u7528\u7a0b\u5f0f\u53ea\u9700\u8981\u77e5\u9053\u8cc7\u8a0a\u7684\u683c\u5f0f (representation)\uff0c\u901a\u5e38\u662f HTML\u6216 XML \u6216\u5716\u7247\u4ec0\u9ebc\u7684\u3002<\/p>\n<p><strong>REST \u6709\u4ec0\u9ebc\u512a\u9ede?<\/strong><\/p>\n<ul>\n<li>\u652f\u63f4\u5feb\u53d6 caching \u5c07\u6539\u5584\u53cd\u61c9\u6642\u9593\u8ddfserver\u7684\u8ca0\u8f09\u80fd\u529b\u3002<\/li>\n<li>\u56e0\u70ba\u4e0d\u5fc5\u7dad\u6301\u9023\u7d50\u72c0\u614b\uff0c\u5927\u5927\u6539\u5584 server \u7684 scalability \u80fd\u529b\u3002\u9019\u8868\u793a\u4e0d\u540cserver\u53ef\u4ee5\u8655\u7406\u540c\u4e00\u4e32 requests\u3002<\/li>\n<li>\u4e00\u500b\u700f\u89bd\u5668\u5c31\u53ef\u4ee5\u5b58\u53d6\u4efb\u4e00\u61c9\u7528\u7a0b\u5f0f\u8ddf\u8cc7\u6e90\uff0cclient \u7aef\u4e0d\u9700\u4f7f\u7528\u5225\u7684\u8edf\u9ad4\u3002<\/li>\n<li>\u5728HTTP\u4e4b\u4e0a\u4e0d\u4f9d\u5b58\u5176\u4ed6\u6a5f\u5236\u8ddf\u8edf\u9ad4\u3002<\/li>\n<li>\u8ddf\u5176\u4ed6\u9023\u7d50\u65b9\u5f0f\u76f8\u6bd4(\u5982RPC)\uff0c\u53ef\u4ee5\u63d0\u4f9b\u76f8\u7b49\u7684\u529f\u80fd\u3002<\/li>\n<li>\u4e0d\u9700\u8981\u5176\u4ed6\u7684 discovery \u6a5f\u5236\uff0c\u56e0\u70ba\u4f7f\u7528\u8d85\u9023\u7d50\u4e86\u3002<\/li>\n<li>\u63d0\u4f9b\u6bd4RPC\u66f4\u597d\u7684\u9577\u671f\u76f8\u5bb9\u6027\uff0c\u56e0\u70ba :<\/li>\n<\/ul>\n<ul>\n<li>\u5982\u540cHTML\u9019\u7a2e\u6587\u4ef6\u5177\u6709\u5f8c\u524d\u53ca\u5411\u5f8c\u7684\u76f8\u5bb9\u80fd\u529b<\/li>\n<li>\u652f\u63f4\u65b0\u7684\u5167\u5bb9\u683c\u5f0f\u4e0d\u9700\u8981\u4e1f\u6389\u820a\u7684<\/li>\n<\/ul>\n<p>\u53e6\u5916\u6bd4\u8d77RPC-style\uff0cURL command line \u6709\u6975\u4f73\u7684 human-friendly \u512a\u9ede\uff0c\u5bb9\u6613 discovered\/ transmitted \/scripted\/bookmarked \u4e00\u500b URL\u3002\u8acb\u53c3\u8003 <a href=\"http:\/\/www.xml.com\/pub\/a\/2004\/03\/17\/udell.html\">The Beauty of REST<\/a>\u00a0\u8ddf <a href=\"http:\/\/207.22.26.166\/bytecols\/2001-08-15.html\">Tangled in the Threads<\/a>\u00a0\u7684\u512a\u9ede\u4ecb\u7d39\u3002<\/p>\n<p><strong>\u8ddf RPC \u7684\u6bd4\u8f03<\/strong><\/p>\n<p>\u8ddf REST Web \u61c9\u7528\u7a0b\u5f0f\u5c0d\u6bd4\u7684\u5c31\u662f RPC\u00a0(Remote procedure call\uff0c\u5be6\u4f5c\u4e0a\u6709XML-RPC\u6216SOAP\u7b49) \u4e86\u3002RPC \u61c9\u7528\u7a0b\u5f0f\u66dd\u9732\u4e00\u6216\u591a\u500b\u7db2\u8def\u7269\u4ef6\uff0c\u6bcf\u500b\u6709\u7279\u5b9a\u7684 functions \u53ef\u4ee5\u547c\u53eb\u3002\u5728 client \u8207\u7269\u4ef6\u6e9d\u901a\u4e4b\u524d\uff0c\u5b83\u5fc5\u9808\u77e5\u9053\u9019\u500b\u7269\u4ef6\u7684\u77e5\u8b58\u4f86\u64cd\u4f5c\u3002<\/p>\n<p>REST \u7684\u8a2d\u8a08\u9650\u5236\u4e86 resource \u7684\u9762\u5411\uff0c\u5b83\u5b9a\u7fa9\u4e86\u4ecb\u9762\u00a0 (\u52d5\u8a5e verbs \u8ddf\u5167\u5bb9\u578b\u5225 content types)\uff0c\u5c0e\u81f4\u6bd4RPC\u66f4\u5c11\u7684\u578b\u5225\uff0c\u4f46\u662f\u66f4\u591a\u7684resource identifiers (\u540d\u8a5enouns)\u3002REST \u7684\u8a2d\u8a08\u5c0b\u6c42\u5b9a\u7fa9\u4e00\u7d44 resources \u8b93 Clients \u53ef\u4ee5\u4e00\u81f4\u6027\u7684\u4e92\u52d5\uff0c\u800c\u4e14\u63d0\u4f9b\u8d85\u9023\u7d50\u5728\u8cc7\u6e90\u4e4b\u9593\u53ef\u4ee5\u700f\u89bd\uff0c\u800c\u4e0d\u9700\u8981\u4e86\u89e3\u6574\u500b resources \u7684\u77e5\u8b58 \u3002Server \u63d0\u4f9b\u7684\u8868\u55ae forms \u4e5f\u53ef\u4ee5\u88ab\u7528\u5728 RESTful \u7684\u74b0\u5883\u4f86\u63cf\u8ff0\u00a0clients \u5982\u4f55\u5efa\u69cb URL \u4f86\u8ddf\u7279\u5b9a\u7684resource\u505a\u6e9d\u901a\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/upload.wikimedia.org\/wikipedia\/en\/thumb\/8\/89\/Resttriangle.svg\/273px-Resttriangle.svg.png\" \/><\/p>\n<p>\u9019\u5f35\u5716\u6307\u51fa\u4e86REST\u7684<a href=\"http:\/\/rest.blueoxen.net\/cgi-bin\/wiki.pl?RestTriangle\">\u4e09\u4f4d\u4e00\u9ad4<\/a> : Nouns, \u6709\u9650\u7684 Verbs \u8ddf Content Types\u3002<\/p>\n<p>\u9700\u6ce8\u610f\u7684\u662f\uff0c\u6839\u64da\u4e0d\u540c\u7684\u7528\u6cd5\u8981\u6c42\u8ddf\u6548\u7387\uff0c\u5728\u4e0d\u540c\u7684\u61c9\u7528\u7a0b\u5f0f\u74b0\u5883\u4e2d\uff0c\u8a72\u4f7f\u7528\u54ea\u7a2e\u67b6\u69cb\u4ecd\u6709\u5f88\u5927\u8a0e\u8ad6\u7684\u7a7a\u9593\u8ddf\u722d\u8b70(SOAP\u7684\u652f\u6301\u8005\u8a8d\u70baREST\u4ecd\u6709\u5176<a href=\"http:\/\/taiwan.cnet.com\/enterprise\/technology\/0,2000062852,20093381,00.htm\">\u4fb7\u9650<\/a>\uff0c\u53ea\u9069\u5408\u7c21\u55ae\u7684\u61c9\u7528)\u3002REST\u7684\u91cd\u8981\u6027\u5728\u65bc\u5b83\u6709\u500b\u76ee\u524d\u6700\u6210\u529f\u7684\u5927\u578b\u8edf\u9ad4\u67b6\u69cb\u61c9\u7528: Wide World Web\u3002RESTful \u662f Web \u7684\u5929\u6027\uff0c\u4e5f\u662f\u8b93 Web \u6210\u529f\u7684\u539f\u56e0\uff0c\u56e0\u6b64 RESTful \u7684\u652f\u6301\u8005\u8a8d\u70ba\u4f7f\u7528 RESTful \u67b6\u69cb\u5c31\u662f Web\u4e0a\u6700\u597d\u7684\u65b9\u6cd5\u4f86\u505a\u5230\u6709\u64f4\u5145\u6027(scalable),\u5f48\u6027\u8ddf\u6709\u5a01\u529b\u7684\u61c9\u7528\u7a0b\u5f0f\u3002\u5728\u6709\u9019\u9ebc\u591a\u8907\u96dc\u7684RPC\u6280\u8853\u4e4b\u5f8c\uff0cREST\u56e0\u5176\u7c21\u55ae\u53c8\u6709\u5a01\u529b\u7684\u67b6\u69cb\u8fd1\u4f86\u8d8a\u4f86\u8d8a\u53d7\u5230\u77da\u76ee\u8ddf\u91cd\u8996\u3002<\/p>\n<p><strong>\u8209\u4f8b<\/strong><\/p>\n<p>\u4e00\u500b RPC \u61c9\u7528\u7a0b\u5f0f\u53ef\u80fd\u6703\u5b9a\u7fa9\u4ee5\u4e0b\u7684\u64cd\u4f5c:<\/p>\n<blockquote><p>getUser()<br \/>\naddUser()<br \/>\nremoveUser()<br \/>\nupdateUser()<br \/>\ngetLocation()<br \/>\naddLocation()<br \/>\nremoveLocation()<br \/>\nupdateLocation()<br \/>\nlistUsers()<br \/>\nlistLocations()<br \/>\nfindLocation()<br \/>\nfindUser()<\/p><\/blockquote>\n<p>Client \u7684\u7a0b\u5f0f\u78bc\u53ef\u80fd\u6703\u9019\u6a23\u5b58\u53d6:<\/p>\n<blockquote><p>exampleAppObject = new ExampleApp(&#8220;<a href=\"http:\/\/example.com\" class=\"autohyperlink\">example.com<\/a>:1234&#8243;)<br \/>\nexampleAppObject.getUser()<\/p><\/blockquote>\n<p>\u5728 REST\u4e2d\uff0c\u91cd\u9ede\u5728 resources(\u6216\u7a31\u4f5c nouns)\u7684\u591a\u6a23\u6027\uff0c\u6bd4\u5982\u8aaa\u53ef\u80fd\u6709\u4ee5\u4e0b\u7684\u7528\u6cd5:<\/p>\n<blockquote><p><a href=\"http:\/\/example.com\/users\/\" class=\"autohyperlink\">example.com\/users\/<\/a><br \/>\n<a href=\"http:\/\/example.com\/users\/\" class=\"autohyperlink\">example.com\/users\/<\/a>{user} (one for each user)<br \/>\n<a href=\"http:\/\/example.com\/findUserForm\" class=\"autohyperlink\">example.com\/findUserForm<\/a><br \/>\n<a href=\"http:\/\/example.com\/locations\/\" class=\"autohyperlink\">example.com\/locations\/<\/a><br \/>\n<a href=\"http:\/\/example.com\/locations\/\" class=\"autohyperlink\">example.com\/locations\/<\/a>{location} (one for each location)<br \/>\n<a href=\"http:\/\/example.com\/findLocationForm\" class=\"autohyperlink\">example.com\/findLocationForm<\/a><\/p><\/blockquote>\n<p>Client \u7684\u7a0b\u5f0f\u78bc\u53ef\u80fd\u9019\u6a23\u5b58\u53d6:<\/p>\n<blockquote><p>userResource = new Resource(http:\/\/example.com\/users\/001)<br \/>\nuserResource.get()<\/p><\/blockquote>\n<p>\u6bcf\u500b resource \u64c1\u6709\u81ea\u5df1\u7684\u8b58\u5225\u540d\u8a5e\uff0c\u800c Clients \u5f9e\u55ae\u4e00 resource \u958b\u59cb\u700f\u89bd\uff0c\u900f\u904e\u6a19\u6e96\u64cd\u4f5c\u8d70\u8a2a resource\u00a0\uff0c\u5982 GET \u4e0b\u8f09\uff0cPUT\u66f4\u65b0\uff0cDELETE\u522a\u9664\uff0cPOST\u65b0\u589e\uff0c\u6ce8\u610f\u5230\u6bcf\u500b\u7269\u4ef6\u6709\u81ea\u5df1\u7684URL\uff0c\u800c\u4e14\u53ef\u4ee5\u5bb9\u6613\u88ab\u5feb\u53d6\uff0c\u8907\u88fd\u8ddf\u66f8\u7c64\u5316(bookmarked)\u3002<\/p>\n<p><strong>\u53c3\u8003\u8cc7\u6e90<\/strong><\/p>\n<ul>\n<li><a href=\"http:\/\/en.wikipedia.org\/wiki\/Representational_State_Transfer\">Representational State Transfer<\/a><\/li>\n<li><a href=\"http:\/\/rest.blueoxen.net\/cgi-bin\/wiki.pl?FrontPage\">RestWiki<\/a><\/li>\n<li><a href=\"http:\/\/www.xml.com\/pub\/a\/2004\/12\/01\/restful-web.html\">How to Create a REST Protocol<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Update(2008\/5): \u4e8b\u9694\u4e00\u5e74\u591a\uff0c\u6211\u5c0d\u65bc Rails \u5982\u4f55\u61c9\u7528 RESTful \u9019\u500b\u6982\u5ff5\u6709\u5b8c\u5168\u4e0d\u540c\u7684 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/ihower.tw\/blog\/1542-rest-and-restful\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008\u4ec0\u9ebc\u662fREST\u8ddfRESTful?\u3009<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5,53,28],"tags":[],"class_list":["post-1542","post","type-post","status-publish","format-standard","hentry","category-programming","category-rails","category-rest","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1q6tG-oS","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/1542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/comments?post=1542"}],"version-history":[{"count":2,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/1542\/revisions"}],"predecessor-version":[{"id":5579,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/1542\/revisions\/5579"}],"wp:attachment":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/media?parent=1542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/categories?post=1542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/tags?post=1542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}