{"id":2713,"date":"2011-03-15T17:03:20","date_gmt":"2011-03-15T09:03:20","guid":{"rendered":"http:\/\/edsionte.com\/techblog\/?p=2713"},"modified":"2011-03-20T18:03:23","modified_gmt":"2011-03-20T10:03:23","slug":"linux%e4%b8%8b%e7%9a%84socket%e7%bc%96%e7%a8%8b-%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"http:\/\/edsionte.com\/techblog\/archives\/2713","title":{"rendered":"Linux\u4e0b\u7684socket\u7f16\u7a0b-\u670d\u52a1\u5668"},"content":{"rendered":"<p>\u6211\u4eec\u90fd\u77e5\u9053\uff0c\u540c\u4e00\u53f0\u8ba1\u7b97\u673a\u4e0a\u7684\u8fdb\u7a0b\u53ef\u4ee5\u901a\u8fc7IPC\uff08\u8fdb\u7a0b\u95f4\u901a\u4fe1\uff09\u673a\u5236\u8fdb\u884c\u901a\u4fe1\uff1b\u800c\u4e0d\u540c\u673a\u7b97\u8ba1\u4e0a\u8fd0\u884c\u7684\u8fdb\u7a0b\u5219\u901a\u8fc7\u7f51\u7edcIPC\uff0c\u5373\u5957\u63a5\u5b57\uff08socket\uff09\u8fdb\u884c\u901a\u4fe1\u3002Linux\u4e0b\u7684socket API\u662f\u57fa\u4e8eBSD\u5957\u63a5\u53e3\u800c\u662f\u5b9e\u73b0\u7684\uff0c\u901a\u8fc7\u8fd9\u4e9b\u7edf\u4e00\u7684API\u5c31\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u8fdb\u7a0b\u95f4\u7684\u7f51\u7edc\u901a\u4fe1\u3002\u6b64\u5916\uff0csocket API\u5373\u53ef\u7528\u4e8e\u9762\u5411\u8fde\u63a5\uff08TCP\uff09\u7684\u6570\u636e\u4f20\u8f93\uff0c\u53c8\u53ef\u7528\u4e8e\u65e0\u8fde\u63a5\uff08UDP\uff09\u7684\u6570\u636e\u4f20\u8f93\u3002\u4e00\u822c\u4f7f\u7528Client\/Server\u4ea4\u4e92\u6a21\u578b\u8fdb\u884c\u901a\u4fe1\u3002<\/p>\n<p>\u672c\u6587\u4ee5\u53ca\u4e0b\u6587\u5c06\u5b9e\u73b0\u4e00\u4e2a\u9762\u5411\u8fde\u63a5\u7684C\/S\u901a\u4fe1\u6a21\u578b\u3002\u672c\u6587\u9996\u5148\u4ecb\u7ecd\u670d\u52a1\u5668\u7aef\u7684\u5b9e\u73b0\u3002<\/p>\n<p><strong>1.\u521b\u5efa\u5957\u63a5\u5b57<\/strong><\/p>\n<pre class=\"brush:c\">#include &lt; sys\/socket.h &gt;\r\nint socket(int domain, int type, int protocol);<\/pre>\n<p>\u901a\u8fc7socket\u51fd\u6570\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u5957\u63a5\u5b57\u63cf\u8ff0\u7b26\uff0c\u8fd9\u4e2a\u63cf\u8ff0\u7b26\u7c7b\u4f3c\u6587\u4ef6\u63cf\u8ff0\u7b26\u3002\u901a\u8fc7\u8fd9\u4e2a\u5957\u63a5\u5b57\u63cf\u8ff0\u7b26\u5c31\u53ef\u4ee5\u5bf9\u670d\u52a1\u5668\u8fdb\u884c\u5404\u79cd\u76f8\u5173\u64cd\u4f5c\u3002<\/p>\n<p>\u8be5\u51fd\u6570\u5305\u542b\u4e09\u4e2a\u53c2\u6570\uff0cdomain\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u6240\u521b\u5efa\u5957\u63a5\u5b57\u7684\u534f\u8bae\u7c7b\u578b\u3002\u901a\u5e38\u9009\u7528AF_INET\uff0c\u8868\u793a\u4f7f\u7528IPv4\u7684TCP\/IP\u534f\u8bae\uff1b\u5982\u679c\u53ea\u5728\u672c\u673a\u5185\u8fdb\u884c\u8fdb\u7a0b\u95f4\u901a\u4fe1\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528AF_UNIX\u3002\u53c2\u6570type\u7528\u6765\u6307\u5b9a\u5957\u63a5\u5b57\u7684\u7c7b\u578b\uff0cSOCK_STREAM\u7528\u4e8e\u521b\u5efa\u4e00\u4e2aTCP\u6d41\u7684\u5957\u63a5\u5b57\uff0cSOCK_DGRAM\u7528\u4e8e\u521b\u5efaUDP\u6570\u636e\u62a5\u5957\u63a5\u5b57\u3002\u53c2\u6570protocol\u901a\u5e38\u53d60\u3002\u5bf9\u4e8e\u672c\u6587\u6240\u63cf\u8ff0\u7684\u670d\u52a1\u5668\uff0c\u521b\u5efa\u5957\u63a5\u5b57\u7684\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush:c\">\tif((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\r\n\r\n\t\tprintf(\"socket error!\\n\");\r\n\t\texit(1);\r\n\t}<\/pre>\n<p><strong>2.\u7ed1\u5b9a\u5957\u63a5\u5b57<\/strong><\/p>\n<p>\u5bf9\u4e8e\u670d\u52a1\u5668\u800c\u8a00\uff0c\u5b83\u7684IP\u5730\u5740\u548c\u7aef\u53e3\u53f7\u4e00\u822c\u662f\u56fa\u5b9a\u7684\u3002\u670d\u52a1\u5668\u7684IP\u5373\u4e3a\u672c\u5730IP\uff0c\u800c\u670d\u52a1\u5668\u7684\u7aef\u53e3\u53f7\u5219\u9700\u8981\u663e\u793a\u7684\u6307\u5b9a\u3002\u901a\u8fc7bind\u51fd\u6570\u53ef\u5c06\u670d\u52a1\u5668\u5957\u63a5\u5b57\u548c\u4e00\u4e2a\u6307\u5b9a\u7684\u7aef\u53e3\u53f7\u8fdb\u884c\u7ed1\u5b9a\u3002<\/p>\n<p>\u5728\u5177\u4f53\u4ecb\u7ecd\u7ed1\u5b9a\u51fd\u6570\u4e4b\u524d\uff0c\u5148\u8bf4\u660e\u4e00\u4e0bsocket\u4e2d\u7684\u5957\u63a5\u5b57\u5730\u5740\u7ed3\u6784\u3002\u7531\u4e8e\u5957\u63a5\u5b57\u662f\u901a\u8fc7IP\u5730\u5740\u548c\u7aef\u53e3\u53f7\u6765\u552f\u4e00\u786e\u5b9a\u7684\uff0c\u56e0\u6b64socket\u63d0\u4f9b\u4e86\u4e00\u79cd\u901a\u7528\u7684\u5957\u63a5\u5b57\u5730\u5740\u7ed3\u6784\uff1a<\/p>\n<pre class=\"brush:c\">   struct sockaddr {\r\n               sa_family_t sa_family;\r\n               char        sa_data[14];\r\n           }<\/pre>\n<p>sa_family\u6307\u5b9a\u4e86\u5957\u63a5\u5b57\u5bf9\u5e94\u7684\u534f\u8bae\u7c7b\u578b\uff0c\u5982\u679c\u4f7f\u7528TCP\/IP\u534f\u8bae\u5219\u6539\u5236\u4e3aAF_INET\uff1bsa_data\u5219\u7528\u6765\u5b58\u50a8\u5177\u4f53\u7684\u5957\u63a5\u5b57\u5730\u5740\u3002\u4e0d\u8fc7\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6bcf\u4e2a\u5177\u4f53\u7684\u534f\u8bae\u65cf\u90fd\u6709\u81ea\u5df1\u7684\u534f\u8bae\u5730\u5740\u683c\u5f0f\u3002\u6bd4\u5982TCP\/IP\u534f\u8bae\u7ec4\u5bf9\u5e94\u7684\u5957\u63a5\u5b57\u5730\u5740\u7ed3\u6784\u4f53\u4e3a\uff1a<\/p>\n<pre class=\"brush:c\">struct sockaddr_in {\r\n\tshort int sin_family; \/* Address family *\/\r\n\tunsigned short int sin_port; \/* Port number *\/\r\n\tstruct in_addr sin_addr; \/* Internet address *\/\r\n\tunsigned char sin_zero[8]; \/* Same size as struct sockaddr *\/\r\n};\r\n\r\nstruct in_addr {\r\n\tunsigned long s_addr;\r\n};<\/pre>\n<p>\u8be5\u5730\u5740\u7ed3\u6784\u548csockaddr\u7ed3\u6784\u5747\u4e3a16\u5b57\u8282\uff0c\u56e0\u6b64\u901a\u5e38\u5728\u7f16\u5199\u57fa\u4e8eTCP\/IP\u534f\u8bae\u7684\u7f51\u7edc\u7a0b\u5e8f\u65f6\uff0c\u4f7f\u7528sockaddr_in\u6765\u8bbe\u7f6e\u5177\u4f53\u5730\u5740\uff0c\u7136\u540e\u518d\u901a\u8fc7\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u4e3asockaddr\u7c7b\u578b\u3002<\/p>\n<p>\u7ed1\u5b9a\u51fd\u6570\u7684\u51fd\u6570\u539f\u578b\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush:c\">       #include &lt; sys\/socket.h &gt;\r\n       int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);<\/pre>\n<p>\u53c2\u6570sockfd\u5373\u670d\u52a1\u5668\u7684\u5957\u63a5\u5b57\u63cf\u8ff0\u7b26\uff1baddr\u53c2\u6570\u6307\u5b9a\u4e86\u5c06socket\u7ed1\u5b9a\u5230\u7684\u672c\u5730\u5730\u5740\uff1baddrlen\u5219\u4e3a\u6240\u4f7f\u7528\u7684\u5730\u5740\u7ed3\u6784\u7684\u957f\u5ea6\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush:c\">\tmemset(&amp;my_addr, 0, sizeof(struct sockaddr_in));\r\n\tmy_addr.sin_family = AF_INET;\r\n\tmy_addr.sin_port = htons(SERV_PORT);\r\n\tmy_addr.sin_addr.s_addr = htonl(INADDR_ANY);\r\n\r\n\tif(bind(sockfd, (struct sockaddr *)&amp;my_addr,\r\n\t\t\t\tsizeof(struct sockaddr_in)) == -1) {\r\n\r\n\t\tprintf(\"bind error!\\n\");\r\n\t\texit(1);\r\n\t}<\/pre>\n<p>\u6ce8\u610f\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u5c06IP\u5730\u5740\u8bbe\u7f6e\u4e3aINADDR_ANY\uff0c\u8fd9\u6837\u5c31\u65e2\u9002\u5408\u5355\u7f51\u5361\u7684\u8ba1\u7b97\u673a\u53c8\u9002\u5408\u591a\u7f51\u5361\u7684\u8ba1\u7b97\u673a\u3002<\/p>\n<p><strong>3.\u5728\u5957\u63a5\u5b57\u4e0a\u76d1\u542c<\/strong><\/p>\n<p>\u5bf9\u4e8eC\/S\u6a21\u578b\u6765\u8bf4\uff0c\u901a\u5e38\u662f\u5ba2\u6237\u7aef\u4e3b\u52a8\u7684\u5bf9\u670d\u52a1\u5668\u7aef\u53d1\u9001\u8fde\u63a5\u8bf7\u6c42\uff0c\u670d\u52a1\u5668\u63a5\u6536\u5230\u8bf7\u6c42\u540e\u518d\u5177\u4f53\u8fdb\u884c\u5904\u7406\u3002\u670d\u52a1\u5668\u53ea\u6709\u8c03\u7528\u4e86listen\u51fd\u6570\u624d\u80fd\u5ba3\u544a\u81ea\u5df1\u53ef\u4ee5\u63a5\u53d7\u5ba2\u6237\u7aef\u7684\u8fde\u63a5\u8bf7\u6c42\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u670d\u52a1\u5668\u6b64\u65f6\u5904\u4e8e\u88ab\u52a8\u76d1\u542c\u72b6\u6001\u3002listen\u51fd\u6570\u7684\u539f\u578b\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush:c\">       #include &lt; sys\/socket.h &gt;\r\n       int listen(int sockfd, int backlog);<\/pre>\n<p>sockfd\u4e3a\u670d\u52a1\u5668\u7aef\u7684\u5957\u63a5\u5b57\u63cf\u8ff0\u7b26\uff0cbacklog\u6307\u5b9a\u4e86\u8be5\u670d\u52a1\u5668\u6240\u80fd\u8fde\u63a5\u5ba2\u6237\u7aef\u7684\u6700\u5927\u6570\u76ee\u3002\u8d85\u8fc7\u8fd9\u4e2a\u8fde\u63a5\u4e66\u76ee\u540e\uff0c\u670d\u52a1\u5668\u5c06\u62d2\u7edd\u63a5\u53d7\u5ba2\u6237\u7aef\u7684\u8fde\u63a5\u8bf7\u6c42\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush:c\">        #define BACKLOG 10\r\n\tif(listen(sockfd, BACKLOG) == -1) {\r\n\r\n\t\tprintf(\"listen error!\\n\");\r\n\t\texit(1);\r\n\t}<\/pre>\n<p><strong>4.\u63a5\u53d7\u8fde\u63a5<\/strong><\/p>\n<p>listen\u51fd\u6570\u53ea\u662f\u5c06\u670d\u52a1\u5668\u5957\u63a5\u5b57\u8bbe\u7f6e\u4e3a\u7b49\u5f85\u5ba2\u6237\u7aef\u8fde\u63a5\u8bf7\u6c42\u7684\u72b6\u6001\uff0c\u771f\u6b63\u63a5\u53d7\u5ba2\u6237\u7aef\u8fde\u63a5\u8bf7\u6c42\u7684\u662faccept\u51fd\u6570\uff1a<\/p>\n<pre class=\"brush:c\">      #include &lt; sys\/socket.h &gt;\r\n       int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);<\/pre>\n<p>accept\u51fd\u6570\u4e2d\u6240\u4f7f\u7528\u7684\u53c2\u6570\u90fd\u5728\u4e0a\u9762\u7684API\u4e2d\u6709\u6240\u63cf\u8ff0\u3002accept\u51fd\u6570\u6267\u884c\u6210\u529f\u540e\u5c06\u8fd4\u56de\u4e00\u4e2a\u4ee3\u8868\u5ba2\u6237\u7aef\u7684\u5957\u63a5\u5b57\u63cf\u8ff0\u7b26\uff0c\u670d\u52a1\u5668\u8fdb\u7a0b\u901a\u8fc7\u8be5\u5957\u63a5\u5b57\u63cf\u8ff0\u7b26\u5c31\u53ef\u4ee5\u4e0e\u5ba2\u6237\u7aef\u8fdb\u884c\u6570\u636e\u4ea4\u6362\u3002<\/p>\n<p><strong>5.\u6570\u636e\u4f20\u8f93<\/strong><\/p>\n<p>\u7531\u4e8esocket\u9002\u7528\u591a\u4e2a\u6570\u636e\u4f20\u8f93\u534f\u8bae\uff0c\u5219\u4e0d\u540c\u7684\u534f\u8bae\u5c31\u5bf9\u5e94\u4e0d\u540c\u7684\u6570\u636e\u4f20\u8f93\u51fd\u6570\u3002\u4e0eTCP\u534f\u8bae\u5bf9\u5e94\u7684\u53d1\u9001\u6570\u636e\u548c\u63a5\u53d7\u6570\u636e\u7684\u51fd\u6570\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush:c\">       #include &lt; sys\/socket.h &gt;\r\n       #include &lt; sys\/types.h &gt;\r\n       ssize_t send(int sockfd, const void *buf, size_t len, int flags);\r\n       ssize_t recv(int sockfd, void *buf, size_t len, int flags);<\/pre>\n<p>\u4ece\u8fd9\u4e24\u4e2a\u51fd\u6570\u7684\u539f\u578b\u53ef\u4ee5\u770b\u4e66\uff0csocket\u4e2d\u7684\u6570\u636e\u4f20\u8f93\u51fd\u6570\u4e0e\u666e\u901a\u6587\u4ef6\u7684\u8bfb\u5199\u51fd\u6570\u7c7b\u4f3c\uff0c\u53ea\u4e0d\u8fc7\u7b2c\u4e00\u4e2a\u53c2\u6570\u9700\u8981\u4f20\u9012\u5957\u63a5\u5b57\u63cf\u8ff0\u7b26\uff1bbuf\u6307\u5b9a\u6570\u636e\u7f13\u51b2\u533a\uff1blen\u4e3a\u6240\u4f20\u8f93\u6570\u636e\u7684\u957f\u5ea6\uff1bflag\u4e00\u822c\u53d60\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush:c\">\twhile (1) {\r\n\t\tsin_size = sizeof(struct sockaddr_in);\r\n\t\tif ((client_fd = accept(sockfd, (struct sockaddr *)&amp;remote_addr, &amp;sin_size)) == -1) {\r\n\t\t\tprintf(\"accept error!\\n\");\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t\/*\r\n                 *\u8fdb\u884c\u76f8\u5e94\u7684\u6570\u636e\u5904\u7406\uff1b\r\n                 *\/\r\n\t}<\/pre>\n<p>\u5982\u793a\u4f8b\u4ee3\u7801\u6240\u793a\uff0c\u901a\u8fc7while\u5faa\u73af\u4f7f\u5f97\u670d\u52a1\u5668\u5bf9\u5ba2\u6237\u7aef\u8fdb\u884c\u6301\u7eed\u76d1\u542c\u3002\u5982\u679c\u5ba2\u6237\u7aef\u6709\u8fde\u63a5\u8bf7\u6c42\u5219\u65b0\u5efa\u4e00\u4e2a\u4ee3\u8868\u5ba2\u6237\u7aef\u7684\u5957\u63a5\u5b57\u63cf\u8ff0\u7b26\uff0c\u8fdb\u800c\u8fdb\u884c\u5bf9\u5ba2\u6237\u7aef\u6570\u636e\u7684\u63a5\u53d7\u548c\u53d1\u9001\u3002<\/p>\n<p>\u4e0a\u8ff0\u7684\u51e0\u4e2a\u51fd\u6570\u5c5e\u4e8e\u7f51\u7edc\u7f16\u7a0b\u4e2d\u6700\u57fa\u672c\u7684\u4e5f\u662f\u6700\u5173\u952e\u7684\u51e0\u4e2aAPI\uff0c\u4f9d\u6b21\u901a\u8fc7\u4e0a\u8ff0\u7684\u65b9\u6cd5\u5c31\u53ef\u4ee5\u5b8c\u6210\u670d\u52a1\u5668\u7aef\u7684\u7a0b\u5e8f\u7684\u7f16\u5199\uff0c\u5177\u4f53\u7684\u8fc7\u7a0b\u8fd8\u53ef\u4ee5\u53c2\u8003\u4e0b\u56fe\uff1a<\/p>\n<p><a rel=\"attachment wp-att-2743\" href=\"http:\/\/edsionte.com\/techblog\/archives\/2713\/server\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2743\" title=\"server\" src=\"http:\/\/edsionte.com\/techblog\/wordpress\/wp-content\/uploads\/2011\/03\/server-86x300.jpg\" alt=\"\" width=\"86\" height=\"300\" srcset=\"http:\/\/edsionte.com\/techblog\/wordpress\/wp-content\/uploads\/2011\/03\/server-86x300.jpg 86w, http:\/\/edsionte.com\/techblog\/wordpress\/wp-content\/uploads\/2011\/03\/server.jpg 212w\" sizes=\"auto, (max-width: 86px) 100vw, 86px\" \/><\/a><\/p>\n<p>\u6b63\u5982\u4e0a\u56fe\u6240\u793a\uff0c\u5728\u5904\u7406\u5b8c\u5ba2\u6237\u7aef\u7684\u6570\u636e\u4f20\u8f93\u8bf7\u6c42\u540e\uff0c\u5fc5\u987b\u901a\u8fc7close\u51fd\u6570\u5173\u95ed\u5ba2\u6237\u7aef\u7684\u8fde\u63a5\u3002<\/p>\n<p><em><strong>\u53c2\u8003\uff1a<\/strong><\/em><\/p>\n<p><em><strong>1.Linux C\u7f16\u7a0b\u5b9e\u6218\uff1b\u7ae5\u6c38\u6e05  \u8457\uff1b\u4eba\u6c11\u90ae\u7535\u51fa\u7248\u793e\uff1b<\/strong><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u4eec\u90fd\u77e5\u9053\uff0c\u540c\u4e00\u53f0\u8ba1\u7b97\u673a\u4e0a\u7684\u8fdb\u7a0b\u53ef\u4ee5\u901a\u8fc7IPC\uff08\u8fdb\u7a0b\u95f4\u901a\u4fe1\uff09\u673a\u5236\u8fdb\u884c\u901a\u4fe1\uff1b\u800c\u4e0d\u540c\u673a\u7b97\u8ba1\u4e0a\u8fd0\u884c\u7684\u8fdb\u7a0b\u5219\u901a\u8fc7\u7f51\u7edcI [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[109,108,209,405],"class_list":["post-2713","post","type-post","status-publish","format-standard","hentry","category-linuxc","tag-c","tag-linux","tag-socket","tag-405"],"views":11305,"_links":{"self":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts\/2713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/comments?post=2713"}],"version-history":[{"count":0,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts\/2713\/revisions"}],"wp:attachment":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/media?parent=2713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/categories?post=2713"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/tags?post=2713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}