learning the difference between String and &str
This commit is contained in:
parent
1cc4ca8661
commit
78594af0ac
@ -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…
Reference in New Issue
Block a user