pub struct RequestOptions {
pub path: HashMap<String, String>,
pub query: HashMap<String, Value>,
pub headers: HashMap<String, String>,
pub body: Option<Value>,
}Expand description
HTTP request options compatible with OpenCode API endpoints.
Fields§
§path: HashMap<String, String>Path parameters used to replace placeholders in endpoint template.
query: HashMap<String, Value>Query string parameters.
headers: HashMap<String, String>Request headers.
body: Option<Value>JSON body payload.
Implementations§
Source§impl RequestOptions
impl RequestOptions
Sourcepub fn with_path(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_path(self, key: impl Into<String>, value: impl Into<String>) -> Self
Adds or overrides one path parameter.
These values are used to render placeholders such as {sessionID}.
Sourcepub fn with_query(self, key: impl Into<String>, value: Value) -> Self
pub fn with_query(self, key: impl Into<String>, value: Value) -> Self
Adds or overrides one query parameter.
Trait Implementations§
Source§impl Clone for RequestOptions
impl Clone for RequestOptions
Source§fn clone(&self) -> RequestOptions
fn clone(&self) -> RequestOptions
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 RequestOptions
impl Debug for RequestOptions
Source§impl Default for RequestOptions
impl Default for RequestOptions
Source§fn default() -> RequestOptions
fn default() -> RequestOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RequestOptions
impl RefUnwindSafe for RequestOptions
impl Send for RequestOptions
impl Sync for RequestOptions
impl Unpin for RequestOptions
impl UnsafeUnpin for RequestOptions
impl UnwindSafe for RequestOptions
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