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 to Build This Project On Ubuntu Linux #488

Open
bhaijiyunus opened this issue Feb 21, 2023 · 3 comments
Open

How to Build This Project On Ubuntu Linux #488

bhaijiyunus opened this issue Feb 21, 2023 · 3 comments

Comments

@bhaijiyunus
Copy link

HI,

From the README it seems that the steps mentioned is to build on Window's system. Can you share or add how to build this project on Ubuntu Linux.

I just clone this project on Ubuntu Linux & simply did, but stuck with some error.
image

Please help to build this project on Linux.
FYI, I am new to the Rust world, just beginner.

Thanks,
Yunus

@sagebind
Copy link
Collaborator

sagebind commented Feb 21, 2023

Welcome to Rust!

curl-rust is not an application that can be run, so you cannot use cargo run as there is no main function to run. Rather, curl-rust is a library that you can add as a dependency to your application to use. For example, you can create a new Cargo project using cargo new and then add curl-rust as a dependency to your project using cargo add curl. See also this section in The Cargo Book. You do not need to clone this repository in order to use it as a dependency in your code.

That said, if you just want to compile curl-rust by itself, you can do so with cargo build.

@bhaijiyunus
Copy link
Author

Hey Sagebind,

Thanks for the response.
Can we do client certificate based HTTPS API call with curl-rust? I have the end point which require the client certificate & key for authentication. I am able to test the API with simple curl command but looking for help to do in Rust.

Thanks,
Yunus

@sagebind
Copy link
Collaborator

Sure, you can supply client certificates using the appropriate options in your request. curl-rust is a pretty thin wrapper around the libcurl C API, so generally any examples using libcurl you can find will translate pretty easily to Rust.

Pro tip: If you add the --libcurl flag to whatever curl command you want to replicate, and it will output a full C program that uses the libcurl API to perform a request equivalent to the CLI command. The methods on the Easy struct will generally have the exact same name as the C equivalent CURLOPT_* name.

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

2 participants