pub struct HttpRequest {
pub method: Method,
pub url: String,
pub headers: Vec<(String, String)>,
pub body: Option<String>,
}Fields§
§method: Method§url: String§headers: Vec<(String, String)>§body: Option<String>Already-serialized JSON, or None.
Implementations§
Source§impl HttpRequest
impl HttpRequest
pub fn get(url: impl Into<String>) -> Self
pub fn delete(url: impl Into<String>) -> Self
pub fn post_json(url: impl Into<String>, body: &Value) -> Self
pub fn put_json(url: impl Into<String>, body: &Value) -> Self
pub fn patch_json(url: impl Into<String>, body: &Value) -> Self
Sourcepub fn delete_json(url: impl Into<String>, body: &Value) -> Self
pub fn delete_json(url: impl Into<String>, body: &Value) -> Self
A DELETE that carries a JSON body (GitHub’s reviewer removal).
pub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for HttpRequest
impl Clone for HttpRequest
Auto Trait Implementations§
impl Forget for HttpRequest
impl Freeze for HttpRequest
impl Move for HttpRequest
impl RefUnwindSafe for HttpRequest
impl Send for HttpRequestwhere
RawVecInner: Send,
impl Sync for HttpRequestwhere
RawVecInner: Sync,
impl Unpin for HttpRequest
impl UnsafeUnpin for HttpRequestwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
impl UnwindSafe for HttpRequestwhere
RawVecInner: UnwindSafe,
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