Hi !
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
With a more simple output
Finished dev [unoptimized + debuginfo] target(s) in 3.99s
Running `target\debug\result02.exe`
{
"origin": "111.111.111.111",
}
More about http calls in next posts!
Happy coding!
Greetings
El Bruno
More posts in my blog ElBruno.com.