alexcrichton / alexcrichton/curl-rust

Reqest example of using multiform post call for begginers.

Ouverte
#463 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Rust
Étoiles
1.1k
Forks
258
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I'm a rust newbie so I'm having problems figuring out how to populate a multipart form.

_....
client.url(&uri).unwrap();
let mut form = Form::new();

client.httppost(form).unwrap();_

I've tried _form.part("loggingin").add();_ but nothing is being added to the form.

https://docs.rs/curl/0.4.44/curl/easy/struct.Easy2.html#method.httppost points me to https://docs.rs/curl/0.4.44/curl/easy/struct.Form.html and then I hit the wall in confusion.

I suspect adding a simple example to the examples directory would be all most people need for a guide. Just something with a key of "Foo" and a value of "Bar" is all I'm after. Like the header example, but that uses List, not Form.

Looking at the tests directory I tried:
form.part("loggingin").contents(b"Yup.").add();

But it doesn't look like it's done anything as
_println!("Form {:#?}", form);_
returns
**Form Form {
fields: "...",
}**

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.