[{"data":1,"prerenderedAt":1130},["ShallowReactive",2],{"navigation":3,"-examples-handle-query":193,"-examples-handle-query-surround":1125},[4,91,138,170,177],{"title":5,"path":6,"stem":7,"children":8,"icon":90},"Guide","/guide","1.guide/0.index",[9,12,53,69],{"title":10,"path":6,"stem":7,"icon":11},"Getting Started","pixel:play",{"title":5,"icon":13,"path":14,"stem":15,"children":16,"page":52},"ph:book-open-duotone","/guide/basics","1.guide/1.basics",[17,22,27,32,37,42,47],{"title":18,"path":19,"stem":20,"icon":21},"Request Lifecycle","/guide/basics/lifecycle","1.guide/1.basics/1.lifecycle","icon-park-outline:handle-round",{"title":23,"path":24,"stem":25,"icon":26},"Routing","/guide/basics/routing","1.guide/1.basics/2.routing","solar:routing-bold",{"title":28,"path":29,"stem":30,"icon":31},"Middleware","/guide/basics/middleware","1.guide/1.basics/3.middleware","mdi:middleware-outline",{"title":33,"path":34,"stem":35,"icon":36},"Event Handlers","/guide/basics/handler","1.guide/1.basics/4.handler","mdi:function",{"title":38,"path":39,"stem":40,"icon":41},"Sending Response","/guide/basics/response","1.guide/1.basics/5.response","tabler:json",{"title":43,"path":44,"stem":45,"icon":46},"Error Handling","/guide/basics/error","1.guide/1.basics/6.error","tabler:error-404",{"title":48,"path":49,"stem":50,"icon":51},"Nested Apps","/guide/basics/nested-apps","1.guide/1.basics/7.nested-apps","material-symbols-light:layers-outline",false,{"title":54,"icon":55,"path":56,"stem":57,"children":58,"page":52},"API","material-symbols-light:api-rounded","/guide/api","1.guide/900.api",[59,64],{"title":60,"path":61,"stem":62,"icon":63},"H3","/guide/api/h3","1.guide/900.api/1.h3","material-symbols:bolt-rounded",{"title":65,"path":66,"stem":67,"icon":68},"H3Event","/guide/api/h3event","1.guide/900.api/2.h3event","material-symbols:data-object-rounded",{"title":70,"icon":71,"path":72,"stem":73,"children":74,"page":52},"Advanced","hugeicons:more-01","/guide/advanced","1.guide/901.advanced",[75,80,85],{"title":76,"path":77,"stem":78,"icon":79},"Plugins","/guide/advanced/plugins","1.guide/901.advanced/1.plugins","clarity:plugin-line",{"title":81,"path":82,"stem":83,"icon":84},"WebSockets","/guide/advanced/websocket","1.guide/901.advanced/2.websocket","hugeicons:live-streaming-02",{"title":86,"path":87,"stem":88,"icon":89},"Nightly Builds","/guide/advanced/nightly","1.guide/901.advanced/9.nightly","game-icons:barn-owl","i-ph:book-open-duotone",{"title":92,"path":93,"stem":94,"children":95,"icon":97},"Utils","/utils","2.utils/0.index",[96,98,103,108,113,118,123,128,133],{"title":92,"path":93,"stem":94,"icon":97},"ph:function-bold",{"title":99,"path":100,"stem":101,"icon":102},"Request","/utils/request","2.utils/1.request","material-symbols-light:input",{"title":104,"path":105,"stem":106,"icon":107},"Response","/utils/response","2.utils/2.response","material-symbols-light:output",{"title":109,"path":110,"stem":111,"icon":112},"Cookie","/utils/cookie","2.utils/3.cookie","material-symbols:cookie-outline",{"title":114,"path":115,"stem":116,"icon":117},"Security","/utils/security","2.utils/4.security","wpf:key-security",{"title":119,"path":120,"stem":121,"icon":122},"Proxy","/utils/proxy","2.utils/5.proxy","arcticons:super-proxy",{"title":124,"path":125,"stem":126,"icon":127},"MCP","/utils/mcp","2.utils/6.mcp","material-symbols:swap-calls",{"title":129,"path":130,"stem":131,"icon":132},"More utils","/utils/more","2.utils/9.more","mingcute:plus-line",{"title":134,"path":135,"stem":136,"icon":137},"Community","/utils/community","2.utils/99.community","lets-icons:external",{"title":139,"path":140,"stem":141,"children":142,"icon":144},"Examples","/examples","4.examples/0.index",[143,145,150,154,158,162,166],{"title":139,"path":140,"stem":141,"icon":144},"ph:code",{"title":146,"path":147,"stem":148,"icon":149},"Cookies","/examples/handle-cookie","4.examples/handle-cookie","ph:arrow-right",{"title":151,"path":152,"stem":153,"icon":149},"HTTP QUERY Method","/examples/handle-query","4.examples/handle-query",{"title":155,"path":156,"stem":157,"icon":149},"Sessions","/examples/handle-session","4.examples/handle-session",{"title":159,"path":160,"stem":161,"icon":149},"Static Assets","/examples/serve-static-assets","4.examples/serve-static-assets",{"title":163,"path":164,"stem":165,"icon":149},"Stream Response","/examples/stream-response","4.examples/stream-response",{"title":167,"path":168,"stem":169,"icon":149},"Validate Data","/examples/validate-data","4.examples/validate-data",{"title":171,"path":172,"stem":173,"children":174,"icon":176},"Migration","/migration","5.migration/0.index",[175],{"title":171,"path":172,"stem":173,"icon":176},"icons8:up-round",{"title":178,"path":179,"stem":180,"children":181},"Blog","/blog","99.blog",[182,185,189],{"title":178,"path":179,"stem":183,"icon":184},"99.blog/index","i-lucide-file-text",{"title":186,"path":187,"stem":188,"icon":184},"H3 1.8 - Towards the Edge of the Web","/blog/v1.8","99.blog/1.v1.8",{"title":190,"path":191,"stem":192,"icon":184},"H3 v2 beta","/blog/v2-beta","99.blog/2.v2-beta",{"id":194,"title":151,"body":195,"description":1119,"extension":1120,"meta":1121,"navigation":1122,"path":152,"seo":1123,"stem":153,"__hash__":1124},"content/4.examples/handle-query.md",{"type":196,"value":197,"toc":1107,"icon":149},"minimark",[198,232,252,260,305,438,459,466,497,609,694,700,706,795,809,813,837,915,921,939,1038,1042,1057,1074,1103],[199,200,201,202,214,215,218,219,223,224,227,228,231],"p",{},"The ",[203,204,208,209,213],"a",{"href":205,"rel":206},"https://www.rfc-editor.org/rfc/rfc10008",[207],"nofollow","HTTP ",[210,211,212],"code",{},"QUERY"," method (RFC 10008)"," is like ",[210,216,217],{},"GET"," — ",[220,221,222],"strong",{},"safe, idempotent, and cacheable"," — but carries a query in the request ",[220,225,226],{},"body"," with a ",[210,229,230],{},"Content-Type",". It's the standard answer to \"I need a GET, but my query is too large or too structured for the URL\".",[199,233,234,235,237,238,244,245,251],{},"H3 supports ",[210,236,212],{}," as a first-class method via ",[203,239,241],{"href":240},"/guide/basics/routing#http-query-method",[210,242,243],{},"app.query()",", a high-level ",[203,246,248],{"href":247},"#define-a-query-handler",[210,249,250],{},"defineQueryHandler"," factory, and two lower-level helper utilities.",[253,254,256,257,259],"h2",{"id":255},"define-a-query-handler","Define a ",[210,258,212],{}," Handler",[199,261,262,267,268,271,272,275,276,278,279,282,283,282,286,289,290,293,294,296,297,300,301,304],{},[203,263,265],{"href":264},"/utils/request#definequeryhandlerdef",[210,266,250],{}," captures the whole RFC 10008 ceremony: declare the accepted query ",[210,269,270],{},"formats",", and it advertises them via ",[210,273,274],{},"Accept-Query"," on every response (including errors), validates the request ",[210,277,230],{}," (",[210,280,281],{},"400","/",[210,284,285],{},"415",[210,287,288],{},"422",", plus ",[210,291,292],{},"405"," for non-",[210,295,212],{}," methods), reads the body as text, and passes the matched media type and query to the handler as ",[210,298,299],{},"format"," and ",[210,302,303],{},"query",":",[306,307,312],"pre",{"className":308,"code":309,"language":310,"meta":311,"style":311},"language-ts shiki shiki-themes github-light github-dark github-dark","import { defineQueryHandler } from \"h3\";\n\napp.query(\n  \"/books\",\n  defineQueryHandler({\n    formats: [\"application/sql\", \"application/jsonpath\"],\n    handler: (event, { format, query }) => runQuery(format, query),\n  }),\n);\n","ts","",[210,313,314,337,344,356,365,374,392,426,432],{"__ignoreMap":311},[315,316,319,323,327,330,334],"span",{"class":317,"line":318},"line",1,[315,320,322],{"class":321},"so5gQ","import",[315,324,326],{"class":325},"slsVL"," { defineQueryHandler } ",[315,328,329],{"class":321},"from",[315,331,333],{"class":332},"sfrk1"," \"h3\"",[315,335,336],{"class":325},";\n",[315,338,340],{"class":317,"line":339},2,[315,341,343],{"emptyLinePlaceholder":342},true,"\n",[315,345,347,350,353],{"class":317,"line":346},3,[315,348,349],{"class":325},"app.",[315,351,303],{"class":352},"shcOC",[315,354,355],{"class":325},"(\n",[315,357,359,362],{"class":317,"line":358},4,[315,360,361],{"class":332},"  \"/books\"",[315,363,364],{"class":325},",\n",[315,366,368,371],{"class":317,"line":367},5,[315,369,370],{"class":352},"  defineQueryHandler",[315,372,373],{"class":325},"({\n",[315,375,377,380,383,386,389],{"class":317,"line":376},6,[315,378,379],{"class":325},"    formats: [",[315,381,382],{"class":332},"\"application/sql\"",[315,384,385],{"class":325},", ",[315,387,388],{"class":332},"\"application/jsonpath\"",[315,390,391],{"class":325},"],\n",[315,393,395,398,401,405,408,410,412,414,417,420,423],{"class":317,"line":394},7,[315,396,397],{"class":352},"    handler",[315,399,400],{"class":325},": (",[315,402,404],{"class":403},"sQHwn","event",[315,406,407],{"class":325},", { ",[315,409,299],{"class":403},[315,411,385],{"class":325},[315,413,303],{"class":403},[315,415,416],{"class":325}," }) ",[315,418,419],{"class":321},"=>",[315,421,422],{"class":352}," runQuery",[315,424,425],{"class":325},"(format, query),\n",[315,427,429],{"class":317,"line":428},8,[315,430,431],{"class":325},"  }),\n",[315,433,435],{"class":317,"line":434},9,[315,436,437],{"class":325},");\n",[199,439,440,441,385,444,447,448,450,451,454,455,458],{},"Formats may use wildcards (",[210,442,443],{},"application/*",[210,445,446],{},"*/*",") — ",[210,449,299],{}," is always the concrete request media type. Pass ",[210,452,453],{},"body: false"," to read the body yourself (e.g. as a stream or with a custom parser); the handler then receives only ",[210,456,457],{},"{ format }",". The sections below show the lower-level utilities it builds on, for when you need custom behavior.",[253,460,462,463,465],{"id":461},"offer-a-cacheable-get-equivalent","Offer a Cacheable ",[210,464,217],{}," Equivalent",[199,467,468,469,471,472,474,475,477,478,481,482,485,486,488,489,493,494,496],{},"A ",[210,470,212],{}," response is not URL-addressable (and content-keyed ",[210,473,212],{}," caching is not deployed in practice), so browsers and CDNs won't reuse it. RFC 10008 (§2.3) suggests advertising an equivalent, cacheable ",[210,476,217],{}," via the ",[210,479,480],{},"Content-Location"," header. Pass ",[210,483,484],{},"get"," to ",[210,487,250],{}," — the ",[490,491,492],"em",{},"same"," handler serves the advertised ",[210,495,217],{},", so no server-side result store is needed:",[306,498,500],{"className":308,"code":499,"language":310,"meta":311,"style":311},"const searchBooks = defineQueryHandler({\n  formats: [\"application/sql\", \"application/jsonpath\"],\n  get: true,\n  handler: (event, { format, query }) => runQuery(format, query),\n});\n\n// The handler gates the method itself, so one `all` route serves QUERY/GET/HEAD.\napp.all(\"/books\", searchBooks);\n// QUERY /books     -> 200 + Content-Location: /books?q=\u003Cquery>&f=\u003Cformat>\n// GET /books?q=... -> same result, ordinary HTTP caching applies\n",[210,501,502,519,532,542,567,572,576,582,598,603],{"__ignoreMap":311},[315,503,504,507,511,514,517],{"class":317,"line":318},[315,505,506],{"class":321},"const",[315,508,510],{"class":509},"suiK_"," searchBooks",[315,512,513],{"class":321}," =",[315,515,516],{"class":352}," defineQueryHandler",[315,518,373],{"class":325},[315,520,521,524,526,528,530],{"class":317,"line":339},[315,522,523],{"class":325},"  formats: [",[315,525,382],{"class":332},[315,527,385],{"class":325},[315,529,388],{"class":332},[315,531,391],{"class":325},[315,533,534,537,540],{"class":317,"line":346},[315,535,536],{"class":325},"  get: ",[315,538,539],{"class":509},"true",[315,541,364],{"class":325},[315,543,544,547,549,551,553,555,557,559,561,563,565],{"class":317,"line":358},[315,545,546],{"class":352},"  handler",[315,548,400],{"class":325},[315,550,404],{"class":403},[315,552,407],{"class":325},[315,554,299],{"class":403},[315,556,385],{"class":325},[315,558,303],{"class":403},[315,560,416],{"class":325},[315,562,419],{"class":321},[315,564,422],{"class":352},[315,566,425],{"class":325},[315,568,569],{"class":317,"line":367},[315,570,571],{"class":325},"});\n",[315,573,574],{"class":317,"line":376},[315,575,343],{"emptyLinePlaceholder":342},[315,577,578],{"class":317,"line":394},[315,579,581],{"class":580},"sCsY4","// The handler gates the method itself, so one `all` route serves QUERY/GET/HEAD.\n",[315,583,584,586,589,592,595],{"class":317,"line":428},[315,585,349],{"class":325},[315,587,588],{"class":352},"all",[315,590,591],{"class":325},"(",[315,593,594],{"class":332},"\"/books\"",[315,596,597],{"class":325},", searchBooks);\n",[315,599,600],{"class":317,"line":434},[315,601,602],{"class":580},"// QUERY /books     -> 200 + Content-Location: /books?q=\u003Cquery>&f=\u003Cformat>\n",[315,604,606],{"class":317,"line":605},10,[315,607,608],{"class":580},"// GET /books?q=... -> same result, ordinary HTTP caching applies\n",[199,610,611,612,614,615,617,618,620,621,282,623,626,627,630,631,634,635,638,639,642,643,646,647,649,650,652,653,655,656,658,659,661,662,664,665,667,668,278,670,675,676,678,679,681,682,685,686,689,690,693],{},"With ",[210,613,484],{}," set, the handler receives the resolved ",[210,616,303],{}," in its context on both paths (read from the body on ",[210,619,212],{},", from the URL param on ",[210,622,217],{},[210,624,625],{},"HEAD","). ",[210,628,629],{},"get: true"," uses the default ",[210,632,633],{},"?q="," / ",[210,636,637],{},"?f="," param names; pass a string to set the query param (",[210,640,641],{},"get: \"q\"",") or an object to set both (",[210,644,645],{},"get: { param, formatParam }","). On ",[210,648,217],{},", the format comes from ",[210,651,637],{}," and may be omitted when exactly one concrete format is accepted; rejections on the ",[210,654,217],{}," path are ",[210,657,281],{},". ",[210,660,480],{}," preserves the request's existing search params and is skipped when the equivalent URL would exceed 2048 characters — very long queries are the reason ",[210,663,212],{}," exists. ",[210,666,625],{}," is served as the bodiless form of the cacheable ",[210,669,217],{},[203,671,674],{"href":672,"rel":673},"https://www.rfc-editor.org/rfc/rfc9110#section-9.3.2",[207],"RFC 9110 §9.3.2"," — there is no HEAD-of-",[210,677,212],{},"), so it works only when ",[210,680,484],{}," is set. Registering with ",[210,683,684],{},"app.all"," covers all three and returns ",[210,687,688],{},"405 Method Not Allowed"," (with an ",[210,691,692],{},"Allow"," header) for any other method — the handler enforces the allowed verbs itself, so you don't wire up per-method routes.",[253,695,697,698,259],{"id":696},"register-a-query-handler","Register a ",[210,699,212],{},[199,701,702,703,304],{},"Read the request body just like you would for a ",[210,704,705],{},"POST",[306,707,709],{"className":308,"code":708,"language":310,"meta":311,"style":311},"import { readBody } from \"h3\";\n\napp.query(\"/books\", async (event) => {\n  const query = await readBody(event, { type: \"text\" });\n  return runSearch(query);\n});\n",[210,710,711,724,728,755,780,791],{"__ignoreMap":311},[315,712,713,715,718,720,722],{"class":317,"line":318},[315,714,322],{"class":321},[315,716,717],{"class":325}," { readBody } ",[315,719,329],{"class":321},[315,721,333],{"class":332},[315,723,336],{"class":325},[315,725,726],{"class":317,"line":339},[315,727,343],{"emptyLinePlaceholder":342},[315,729,730,732,734,736,738,740,743,745,747,750,752],{"class":317,"line":346},[315,731,349],{"class":325},[315,733,303],{"class":352},[315,735,591],{"class":325},[315,737,594],{"class":332},[315,739,385],{"class":325},[315,741,742],{"class":321},"async",[315,744,278],{"class":325},[315,746,404],{"class":403},[315,748,749],{"class":325},") ",[315,751,419],{"class":321},[315,753,754],{"class":325}," {\n",[315,756,757,760,763,765,768,771,774,777],{"class":317,"line":358},[315,758,759],{"class":321},"  const",[315,761,762],{"class":509}," query",[315,764,513],{"class":321},[315,766,767],{"class":321}," await",[315,769,770],{"class":352}," readBody",[315,772,773],{"class":325},"(event, { type: ",[315,775,776],{"class":332},"\"text\"",[315,778,779],{"class":325}," });\n",[315,781,782,785,788],{"class":317,"line":367},[315,783,784],{"class":321},"  return",[315,786,787],{"class":352}," runSearch",[315,789,790],{"class":325},"(query);\n",[315,792,793],{"class":317,"line":376},[315,794,571],{"class":325},[199,796,797,798,800,801,805,806,808],{},"Because ",[210,799,212],{}," carries an attacker-controllable body, ",[203,802,804],{"href":803},"/utils/request#assertbodysizeevent-limit","body-size limits"," apply just like ",[210,807,705],{},".",[253,810,812],{"id":811},"advertise-accepted-formats","Advertise Accepted Formats",[199,814,815,816,822,823,825,826,831,832,834,835,304],{},"Use ",[203,817,819],{"href":818},"/utils/request#appendacceptqueryevent-mediatypes",[210,820,821],{},"appendAcceptQuery"," to tell clients which query formats a resource understands. It sets the ",[210,824,274],{}," response header (a ",[203,827,830],{"href":828,"rel":829},"https://www.rfc-editor.org/rfc/rfc8941",[207],"Structured Fields"," List), and can be set on a plain ",[210,833,217],{}," too so clients can discover formats before sending a ",[210,836,212],{},[306,838,840],{"className":308,"code":839,"language":310,"meta":311,"style":311},"import { appendAcceptQuery } from \"h3\";\n\napp.get(\"/books\", (event) => {\n  appendAcceptQuery(event, [\"application/sql\", \"application/jsonpath\"]);\n  // Accept-Query: application/sql, application/jsonpath\n  return \"Send a QUERY request with a SQL or JSONPath body.\";\n});\n",[210,841,842,855,859,880,897,902,911],{"__ignoreMap":311},[315,843,844,846,849,851,853],{"class":317,"line":318},[315,845,322],{"class":321},[315,847,848],{"class":325}," { appendAcceptQuery } ",[315,850,329],{"class":321},[315,852,333],{"class":332},[315,854,336],{"class":325},[315,856,857],{"class":317,"line":339},[315,858,343],{"emptyLinePlaceholder":342},[315,860,861,863,865,867,869,872,874,876,878],{"class":317,"line":346},[315,862,349],{"class":325},[315,864,484],{"class":352},[315,866,591],{"class":325},[315,868,594],{"class":332},[315,870,871],{"class":325},", (",[315,873,404],{"class":403},[315,875,749],{"class":325},[315,877,419],{"class":321},[315,879,754],{"class":325},[315,881,882,885,888,890,892,894],{"class":317,"line":358},[315,883,884],{"class":352},"  appendAcceptQuery",[315,886,887],{"class":325},"(event, [",[315,889,382],{"class":332},[315,891,385],{"class":325},[315,893,388],{"class":332},[315,895,896],{"class":325},"]);\n",[315,898,899],{"class":317,"line":367},[315,900,901],{"class":580},"  // Accept-Query: application/sql, application/jsonpath\n",[315,903,904,906,909],{"class":317,"line":376},[315,905,784],{"class":321},[315,907,908],{"class":332}," \"Send a QUERY request with a SQL or JSONPath body.\"",[315,910,336],{"class":325},[315,912,913],{"class":317,"line":394},[315,914,571],{"class":325},[253,916,918,919],{"id":917},"validate-the-content-type","Validate the ",[210,920,230],{},[199,922,815,923,929,930,932,933,935,936,938],{},[203,924,926],{"href":925},"/utils/request#requirecontenttypeevent-acceptedtypes",[210,927,928],{},"requireContentType"," to enforce the RFC's error semantics. It returns the matched media type, or throws ",[210,931,281],{}," (missing), ",[210,934,285],{}," (unsupported), or ",[210,937,288],{}," (malformed):",[306,940,942],{"className":308,"code":941,"language":310,"meta":311,"style":311},"import { requireContentType, readBody } from \"h3\";\n\napp.query(\"/books\", async (event) => {\n  const type = requireContentType(event, [\"application/sql\", \"application/jsonpath\"]);\n  const query = await readBody(event, { type: \"text\" });\n  return runQuery(type, query);\n});\n",[210,943,944,957,961,985,1007,1025,1034],{"__ignoreMap":311},[315,945,946,948,951,953,955],{"class":317,"line":318},[315,947,322],{"class":321},[315,949,950],{"class":325}," { requireContentType, readBody } ",[315,952,329],{"class":321},[315,954,333],{"class":332},[315,956,336],{"class":325},[315,958,959],{"class":317,"line":339},[315,960,343],{"emptyLinePlaceholder":342},[315,962,963,965,967,969,971,973,975,977,979,981,983],{"class":317,"line":346},[315,964,349],{"class":325},[315,966,303],{"class":352},[315,968,591],{"class":325},[315,970,594],{"class":332},[315,972,385],{"class":325},[315,974,742],{"class":321},[315,976,278],{"class":325},[315,978,404],{"class":403},[315,980,749],{"class":325},[315,982,419],{"class":321},[315,984,754],{"class":325},[315,986,987,989,992,994,997,999,1001,1003,1005],{"class":317,"line":358},[315,988,759],{"class":321},[315,990,991],{"class":509}," type",[315,993,513],{"class":321},[315,995,996],{"class":352}," requireContentType",[315,998,887],{"class":325},[315,1000,382],{"class":332},[315,1002,385],{"class":325},[315,1004,388],{"class":332},[315,1006,896],{"class":325},[315,1008,1009,1011,1013,1015,1017,1019,1021,1023],{"class":317,"line":367},[315,1010,759],{"class":321},[315,1012,762],{"class":509},[315,1014,513],{"class":321},[315,1016,767],{"class":321},[315,1018,770],{"class":352},[315,1020,773],{"class":325},[315,1022,776],{"class":332},[315,1024,779],{"class":325},[315,1026,1027,1029,1031],{"class":317,"line":376},[315,1028,784],{"class":321},[315,1030,422],{"class":352},[315,1032,1033],{"class":325},"(type, query);\n",[315,1035,1036],{"class":317,"line":394},[315,1037,571],{"class":325},[253,1039,1041],{"id":1040},"full-example","Full Example",[199,1043,1044,1045,1048,1049,1051,1052,1054,1055,808],{},"A self-contained, runnable demo — a ",[210,1046,1047],{},"/books"," resource that accepts SQL-ish and JSONPath queries, validates the ",[210,1050,230],{},", and advertises a cacheable ",[210,1053,217],{}," alternative. It also serves a small interactive page at ",[210,1056,282],{},[1058,1059,1061],"read-more",{"to":1060},"https://github.com/h3js/h3/tree/main/examples/query.mjs",[199,1062,1063,1064,1070,1071,808],{},"See the full ",[203,1065,1067],{"href":1060,"rel":1066},[207],[210,1068,1069],{},"examples/query.mjs"," source, or run it locally with ",[210,1072,1073],{},"node examples/query.mjs",[1075,1076,1077],"note",{},[199,1078,1079,1080,385,1082,1084,1085,1088,1089,1092,1093,1099,1100,808],{},"\nUnlike ",[210,1081,217],{},[210,1083,212],{}," is ",[220,1086,1087],{},"not"," CORS-safelisted, so browsers send a preflight. If you pass an explicit ",[210,1090,1091],{},"methods"," allowlist to ",[203,1094,1096],{"href":1095},"/utils/security#handlecorsevent-options",[210,1097,1098],{},"handleCors",", include ",[210,1101,1102],{},"\"QUERY\"",[1104,1105,1106],"style",{},"html pre.shiki code .so5gQ, html code.shiki .so5gQ{--shiki-light:#D73A49;--shiki-default:#F97583;--shiki-dark:#F97583}html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .sfrk1, html code.shiki .sfrk1{--shiki-light:#032F62;--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}html pre.shiki code .shcOC, html code.shiki .shcOC{--shiki-light:#6F42C1;--shiki-default:#B392F0;--shiki-dark:#B392F0}html pre.shiki code .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":311,"searchDepth":339,"depth":339,"links":1108},[1109,1111,1113,1115,1116,1118],{"id":255,"depth":339,"text":1110},"Define a QUERY Handler",{"id":461,"depth":339,"text":1112},"Offer a Cacheable GET Equivalent",{"id":696,"depth":339,"text":1114},"Register a QUERY Handler",{"id":811,"depth":339,"text":812},{"id":917,"depth":339,"text":1117},"Validate the Content-Type",{"id":1040,"depth":339,"text":1041},"Accept safe, cacheable requests that carry a query in the body.","md",{"icon":149},{"icon":149},{"title":151,"description":1119},"akGOlsUiD0Cu8B96Bcf1pxEsUu5KHtjEnlmyHXB7Ub4",[1126,1128],{"title":146,"path":147,"stem":148,"description":1127,"icon":149,"children":-1},"Use cookies to store data on the client.",{"title":155,"path":156,"stem":157,"description":1129,"icon":149,"children":-1},"Remember your users using a session.",1783690727985]