Flask 有没有办法接受完整的 URL 作为 URL 参数?
我知道<path:something>接受带斜杠的路径。但是,我需要接受所有内容,包括之后的查询字符串?,并且path不会捕获它。
http://example.com/someurl.com?andother?yetanother
Run Code Online (Sandbox Code Playgroud)
我想捕捉someurl.com?andother?yetanother。我不提前知道将提供什么查询参数(如果有)。我想避免从 重建查询字符串request.args。
我需要将变量传递给数据结构。但是我不想用所有可能的迭代来构建数据对象。目的是查询 AWS 以获取资源 ID。这是一个示例代码:
variable "subnet" {}
data "aws_subnet" "subnet" {
filter {
name = "state"
values = ["available"]
}
filter {
name = "tag:Name"
values = ["${var.subnet}"]
}
}
output "data" {
value = "${data.aws_subnet.'stage-a'.id}"
}
Run Code Online (Sandbox Code Playgroud)