pub enum HttpRequestBody {
Empty,
Bytes(Bytes),
Text(String),
Json(Bytes),
Form(Bytes),
Multipart(Bytes),
Ndjson(Bytes),
Stream(Vec<Bytes>),
}Expand description
Encodes how the outbound body is represented before sending via reqwest.
Variants§
Empty
No body (typical for GET/HEAD).
Bytes(Bytes)
Opaque binary payload.
Text(String)
UTF-8 text; builders may set Content-Type: text/plain.
Json(Bytes)
JSON-serialized bytes; builders may set Content-Type: application/json.
Form(Bytes)
URL-encoded form bytes; builders may set Content-Type: application/x-www-form-urlencoded.
Multipart(Bytes)
Multipart body bytes; builders may set Content-Type: multipart/form-data; boundary=....
Ndjson(Bytes)
NDJSON bytes (\n-delimited JSON objects); builders may set application/x-ndjson.
Stream(Vec<Bytes>)
Chunked upload payload represented as ordered byte chunks.
The client sends this variant through reqwest streaming body support.
Trait Implementations§
Source§impl Clone for HttpRequestBody
impl Clone for HttpRequestBody
Source§fn clone(&self) -> HttpRequestBody
fn clone(&self) -> HttpRequestBody
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpRequestBody
impl Debug for HttpRequestBody
Source§impl Default for HttpRequestBody
impl Default for HttpRequestBody
Source§fn default() -> HttpRequestBody
fn default() -> HttpRequestBody
Returns the “default value” for a type. Read more
Source§impl PartialEq for HttpRequestBody
impl PartialEq for HttpRequestBody
impl Eq for HttpRequestBody
impl StructuralPartialEq for HttpRequestBody
Auto Trait Implementations§
impl !Freeze for HttpRequestBody
impl RefUnwindSafe for HttpRequestBody
impl Send for HttpRequestBody
impl Sync for HttpRequestBody
impl Unpin for HttpRequestBody
impl UnsafeUnpin for HttpRequestBody
impl UnwindSafe for HttpRequestBody
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.