Struct twilight_http::request::Request [−][src]
pub struct Request { /* fields omitted */ }
Implementations
Create a new request builder.
Examples
Create a request to create a message with a content of “test” in a channel with an ID of 1:
use twilight_http::{request::Request, routing::Route};
let body = br#"{
"content": "test"
}"#.to_vec();
let request = Request::builder(&Route::CreateMessage {
channel_id: 1,
}).body(body).build();
Create a request from only its route information.
If you need to set additional configurations like the body then use
builder
.
Examples
Create a request to get a message with an ID of 2 in a channel with an ID of 1:
use twilight_http::{request::Request, routing::Route};
let request = Request::from_route(&Route::GetMessage {
channel_id: 1,
message_id: 2,
});
Headers to set in the request, if any.
Path used for ratelimiting.
Whether to use the client’s authorization token in the request.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Request
impl UnwindSafe for Request
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more