Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How send MultipartFormData http post request? #3

Open
ZeosBios opened this issue Sep 8, 2022 · 0 comments
Open

How send MultipartFormData http post request? #3

ZeosBios opened this issue Sep 8, 2022 · 0 comments

Comments

@ZeosBios
Copy link

ZeosBios commented Sep 8, 2022

How I can upload file to server use swish?

auto client = Client();

auto multipartFormData = MultipartFormData(&client);
multipartFormData = std::move(multipartFormData.PushField("imageid", "8948"));
multipartFormData = std::move(multipartFormData.PushField("file_type", "img"));
multipartFormData = std::move(multipartFormData.AttachFile("file", "test1.png"));

auto [response, status] = client.Post("http://any.com/uploadImage", &multipartFormData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant