我使用Rocket库,我需要创建一个端点,其中包含动态参数"type",一个关键字.
我试过这样的东西,但它没有编译:
#[get("/offers?<type>")]
pub fn offers_get(type: String) -> Status {
unimplemented!()
}
Run Code Online (Sandbox Code Playgroud)
编译器错误:
error: expected argument name, found keyword `type`
Run Code Online (Sandbox Code Playgroud)
是否有可能在火箭中有一个名为"type"的参数?由于我遵循的规范,我无法重命名参数.