IRequest.GetPostBool method

获取JSON方式提交的Body中的指定键的值并转换为布尔值。

  1. public bool GetPostBool(string name, bool defaultValue = false)
parameter description
name Body中包含的键。
defaultValue Body中不包含键或者键值无法转换为布尔值时的返回值。

Return Value

如果Body中包含指定的键,则返回转换为布尔值后的的值;否则返回 defaultValue。

See Also