OxL Справочник OxL
РусскийEnglish

method Request.queryAll

All values of the query parameter name (decoded), in order.

Example:

oxl✓ проверяется в CI
use std.http { Request, Header }

fn sample() -> Request {
  Request{
    method: "GET", target: "/search?q=oxl&tag=a&tag=b", path: "/search", rawQuery: "q=oxl&tag=a&tag=b", version: "HTTP/1.1",
    headers: [Header{ name: "Accept", value: "text/html" }, Header{ name: "Cookie", value: "sid=42; theme=dark" }, Header{ name: "X-Id", value: "1" }, Header{ name: "x-id", value: "2" }],
    body: Utf8.encode("payload"), peer: "127.0.0.1:50000", params: [Header{ name: "id", value: "7" }]
  }
}

fn main() io {
  print("{sample().queryAll("tag")}")
}
Вывод
["a", "b"]
pub(api) fn queryAll(name: str) -> List<str>

Сложность. O(q) in the length of the query.

С версии. 1.0.0-beta

Параметры

ИмяТип
namestr

Возвращает

List<str>

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/http/http.oxl:1577

См. также