Skip to content

Conversation

@Dev43
Copy link

@Dev43 Dev43 commented Sep 21, 2022

This PR allows for the customization of the reqwest client that the arweave struct uses. This way I can pass custom headers to all the requests in an easy manner such as this:

        let mut headers = header::HeaderMap::new();
        headers.insert(
            "X-Network",
            header::HeaderValue::from_static("arweave.testnet"),
        );
        let mut builder = Client::builder();
        builder = builder.default_headers(headers);

        let c = builder.build().unwrap();

        let r = c
            .get("http://localhost:1984/tx/ready_for_mining")
            .header("Content-Type", "application/x-www-form-urlencoded")
            .send()
            .await?
            .text()
            .await?;

Also added actual methods for last_tx and tx_anchor

Thanks for this lib :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant