DEV Community

peetss
peetss

Posted on

A small contribution

Hi everyone,

Today I was working on adding some HTTP requests to an existing Rust project.

I didn't really know anything about Rust (or Cargo) and something like this would've definitely saved me some frustration and allowed me to get moving more quickly.

https://github.com/peetss/rust-reqwest-example

Maybe if you are looking to try out Rust this might be a nice and easy way to get started. Who doesn't like making HTTP requests?

To be fair, most of this code came from a stackoverflow post, I just turned it into a project that you could import into your IDE of choice.

At the end of the day we are all just standing on the shoulders of giants anyways, right?

Top comments (3)

Collapse
 
curiousdev profile image
CuriousDev

If you like to learn more about doing HTTP request, you can try to set up a simple Web Server for handling requests and a Web Client. The client could be just JavaScript or you have a look at the different possibilities to do normal requests with another language. Surely Rust also provides this. Alternatively you can use a tool like Postman to create requests, which are sent to your server.
Using built-in functions is not the best possibility to learn how it works in general.

Collapse
 
williamlake profile image
William Lake

What do you like about Rust? I've been considering giving it a look, have never used it, and always find personal opinions/experience more valuable than just random Googlin'.

Collapse
 
gklijs profile image
Gerard Klijs

Several things are nice. The error messages are pretty good, and once you get it to compile it probably work well. It's also very low on using memory.