MCPcopy Create free account
hub / github.com/bajrangCoder/setu / get_multipart_fields

Method get_multipart_fields

src/components/multipart_form_data_editor.rs:140–160  ·  view source on GitHub ↗
(&self, cx: &App)

Source from the content-addressed store, hash-verified

138 key: row.key_input.read(cx).text().to_string(),
139 value: row.value_input.read(cx).text().to_string(),
140 file_path: row.file_path.clone(),
141 enabled: row.enabled,
142 })
143 .collect()
144 }
145
146 pub fn get_form_data(&self, cx: &App) -> std::collections::HashMap<String, String> {
147 let mut map = std::collections::HashMap::new();
148 for field in self.get_fields(cx) {
149 if field.enabled && !field.key.is_empty() {
150 if let Some(path) = field.file_path {
151 map.insert(field.key, format!("@{}", path.display()));
152 } else {
153 map.insert(field.key, field.value);
154 }
155 }
156 }
157 map
158 }
159
160 pub fn get_multipart_fields(&self, cx: &App) -> Vec<crate::entities::MultipartField> {
161 self.get_fields(cx)
162 .into_iter()
163 .filter(|f| f.enabled && !f.key.is_empty())

Callers 1

get_request_bodyMethod · 0.80

Calls 3

filterMethod · 0.80
get_fieldsMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected