You can make an HTTP request with a custom method in Rust using either the hyper or reqwest libraries.
Here's an example of making an HTTP request with a custom method using hyper:
main.rs469 chars19 lines
In this example, we create a Request
object with a custom PROPFIND
HTTP method, set the request URI, and set an empty request body. We then use a Client
object from the hyper library to make the request, which returns a Response
object that we can handle as needed.
Here's an example of making an HTTP request with a custom method using the reqwest library:
main.rs340 chars16 lines
In this example, we create a Client
object from the reqwest library and use its request
method to make the HTTP request with the custom PROPFIND
method. We pass the request URI as a string and use the send
method to send the request and get the response, which can be handled as needed.
gistlibby LogSnag