actix-web-query-method-middleware

Crates.ioactix-web-query-method-middleware
lib.rsactix-web-query-method-middleware
version1.0.1
sourcesrc
created_at2022-09-26 05:34:54.067582
updated_at2023-05-11 04:26:43.961215
descriptionAn Actix Web middleware that allows you to reroute `POST` requests to other methods like `PUT` or `DELETE` using a query parameter.
homepage
repositoryhttps://github.com/SeriousBug/actix-web-query-method-middleware
max_upload_size
id673976
size23,489
Kaan Barmore-Genç (SeriousBug)

documentation

README

Crates.io docs.rs GitHub Workflow Status Codecov

An Actix Web middleware that allows you to reroute POST requests to other methods like PUT or DELETE using a query parameter.

This is useful in HTML forms where you can't use methods other than GET or POST. By adding this middleware to your server, you can submit the form to endpoints with methods other than POST by adding a query parameter like /your/url?_method=PUT.

For example:

<form method="post" action="/path/to/endpoint?_method=DELETE">
  <input type="submit" value="Delete this item" />
</form>

See the crate documentation for details.

Development

If you have any suggestions or find any bugs, feel free to open a bug report. If you'd like to contribute, you can send a pull request. If you are thinking of making a big change, you should open an issue first to discuss the changes to avoid wasted effort.

Testing

Run cargo test to test things. If you want to see the debug log output, you can also use RUST_LOG=debug cargo test to see debug logs for failed tests.

Commit count: 10

cargo fmt