Binary file uploads and missing workspace empty state

This commit is contained in:
Gregory Schier
2024-03-10 10:56:38 -07:00
parent ce9ccd34e7
commit efd7e7bf84
27 changed files with 214 additions and 47 deletions

View File

@@ -244,6 +244,13 @@ pub async fn send_http_request(
}
}
request_builder = request_builder.form(&form_params);
} else if body_type == "binary" && request_body.contains_key("filePath") {
let file_path = request_body.get("filePath").unwrap().as_str().unwrap();
request_builder = request_builder.body(
fs::read(file_path)
.map_err(|e| e.to_string())
.expect("Failed to read file"),
);
} else if body_type == "multipart/form-data" && request_body.contains_key("form") {
let mut multipart_form = multipart::Form::new();
if let Some(form_definition) = request_body.get("form") {