DEV Community

peetss
peetss

Posted on

1

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.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay