tie method

Param tie(
  1. String key,
  2. dynamic value, {
  3. ParamType type = ParamType.body,
})

参数绑定 type为发起网络请求时,参数所在的载体位置。默认为body 参数。

Implementation

Param tie(String key, dynamic value, {ParamType type = ParamType.body}) {
  switch (type) {
    case ParamType.body:
      _bodyMap[key] = value;
      break;
    case ParamType.query:
      _queryMap[key] = value;
      break;
    case ParamType.form:
      _formMap[key] = value;
      break;
    case ParamType.path:
      _pathMap[key] = value;
      break;
    case ParamType.header:
      _headerMap[key] = value;
      break;
    default:
  }
  return this;
}