|
@ -21,7 +21,7 @@ struct Cli { |
|
|
#[cfg(not(target_arch = "wasm32"))] |
|
|
#[cfg(not(target_arch = "wasm32"))] |
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> { |
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> { |
|
|
let args = Cli::parse(); |
|
|
let args = Cli::parse(); |
|
|
let url = args.url; |
|
|
let url = args.url.as_str(); |
|
|
let text = args.text; |
|
|
let text = args.text; |
|
|
if text.is_some() { |
|
|
if text.is_some() { |
|
|
let client = reqwest::blocking::Client::new(); |
|
|
let client = reqwest::blocking::Client::new(); |
|
@ -33,7 +33,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { |
|
|
let client = reqwest::blocking::Client::new(); |
|
|
let client = reqwest::blocking::Client::new(); |
|
|
let form = multipart::Form::new().file("file", &file_name)?; |
|
|
let form = multipart::Form::new().file("file", &file_name)?; |
|
|
|
|
|
|
|
|
let res = client.post("your url").multipart(form).send()?; |
|
|
let res = client.post(url).multipart(form).send()?; |
|
|
println!("{:?}", res) |
|
|
println!("{:?}", res) |
|
|
} |
|
|
} |
|
|
Ok(()) |
|
|
Ok(()) |
|
|