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.