rust_webhook-0.1.2 has been yanked.
rust_webhook
The 'rust_webhook' crate is a Rust library that provides functionality for sending webhooks using the 'reqwest' and 'serde_json' libraries. It allows you to easily send POST requests with JSON payloads to webhook endpoints.
How to Use
To use the 'rust_webhook' crate in your Rust project, follow these steps:
- Add the crate as a dependency in your Cargo.toml file:
[]
= { = "0.1" }
= "0.11"
= "1.0"
- Import the
send_hook
function from therust_webhook
crate:
use send_hook;
- Use the send_hook function to send a webhook. Provide the webhook URL and content as arguments. The function returns a Result<(), Box>, indicating success or failure.
async
Replace "https://your-webhook-url" with the actual URL of your webhook endpoint.
- Run your Rust program. If the webhook is sent successfully, it will print a success message. If an error occurs, it will print the error message.
That's it! You can now use the rust_webhook crate to send webhooks in your Rust project.