Yes, I’m starting to use OpenAI services in with Rust. However, before getting here, I spent some time learning how to work with HTTP Requests in Rust.
There seems to be several libraries that can help. I found several examples using [https://docs.rs/reqwest/0.6.2/reqwest/], so I decided to use this one.
A classic example to do this, is to perform an HTTP GET request to the following url, to get our public IP Address.
https://httpbin.org/ip
And hey, the code is super simple
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Leave a comment