Browse Source

learning the difference between String and &str

main
crunk 7 months ago
parent
commit
78594af0ac
  1. 4
      src/main.rs

4
src/main.rs

@ -21,7 +21,7 @@ struct Cli {
#[cfg(not(target_arch = "wasm32"))]
fn main() -> Result<(), Box<dyn std::error::Error>> {
let args = Cli::parse();
let url = args.url;
let url = args.url.as_str();
let text = args.text;
if text.is_some() {
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 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)
}
Ok(())

Loading…
Cancel
Save