Retroqwest

This project is still a work in progress!!

A Rust proc-macro attribute HTTP Client generator from a trait. Inspired by [Retrofit] and [Refit] to bring something like them to rust.

Example

```rust

[derive(Deserialize, Serialize, Clone)]

pub struct HttpBinResponse { pub url: String, }

[retroqwest::retroqwest]

pub trait HttpBin { #[http::get("/anything")] async fn get_anything(&self) -> Result;

#[http::get("/anything/{name}")] async fn getbyname(&self, name: String) -> Result;

#[http::post("/anything/{name}")] async fn posttoname( &self, name: String, #[query] q: bool, #[json] body: &HttpBinResponse, ) -> Result; }

impl HttpBinClient { pub fn new(baseuri: String) -> Result { Self::frombuilder(base_uri, ClientBuilder::default()) } }

// This method allows for better code completion // since impl HttpBin is better than the generated struct... fn build_client(uri: String) -> Result { Ok(HttpBinClient::new(uri)?) } ```

See tests for a full example