pub struct Request {
pub method: Method,
pub path: String,
pub headers: Vec<(String, String)>,
pub query: Vec<(String, String)>,
pub body: Option<Body>,
pub timeout: Option<Duration>,
}Expand description
A request. path is relative to the transport’s base URL (/libraries), or absolute.
Fields§
§method: Method§path: String§headers: Vec<(String, String)>§query: Vec<(String, String)>§body: Option<Body>§timeout: Option<Duration>Overrides the transport’s default timeout.
Implementations§
Source§impl Request
impl Request
pub fn new(method: Method, path: impl Into<String>) -> Self
pub fn get(path: impl Into<String>) -> Self
pub fn post(path: impl Into<String>) -> Self
pub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn query(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn json(self, body: Value) -> Self
pub fn form(self, fields: Vec<(String, String)>) -> Self
Trait Implementations§
impl StructuralPartialEq for Request
Auto Trait Implementations§
impl Forget for Request
impl Freeze for Requestwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<(String, String)>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
impl Move for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Requestwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
impl UnwindSafe for Request
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more