pub struct Http { /* private fields */ }Expand description
Plugin: shared client + request-id middleware.
Implementations§
Source§impl Http
impl Http
pub fn new() -> Self
pub fn deny_private_networks(self) -> Self
pub fn allow_private_networks(self) -> Self
pub fn allow_hosts( self, hosts: impl IntoIterator<Item = impl Into<String>>, ) -> Self
pub fn max_response_size(self, n: usize) -> Self
pub fn timeout(self, d: Duration) -> Self
pub fn fake() -> Self
pub fn with_fake(self, fake: FakeTransport) -> Self
pub fn stub_get(self, url: impl Into<String>, body: impl Into<StubBody>) -> Self
Sourcepub fn get(self, url: impl Into<String>, body: impl Into<StubBody>) -> Self
pub fn get(self, url: impl Into<String>, body: impl Into<StubBody>) -> Self
Alias for Self::stub_get (Laravel-style Http::fake().get(...)).
pub fn stub_post(self, url: impl Into<String>, status: u16) -> Self
pub fn stub_fail(self, url: impl Into<String>, msg: impl Into<String>) -> Self
Sourcepub fn fail(self, url: impl Into<String>, msg: impl Into<String>) -> Self
pub fn fail(self, url: impl Into<String>, msg: impl Into<String>) -> Self
Alias for Self::stub_fail.
Sourcepub fn with_config_from_app(self, app: &App) -> Self
pub fn with_config_from_app(self, app: &App) -> Self
Merge named clients from sova_core::ConfigDoc already on app.
Trait Implementations§
Source§impl Plugin for Http
impl Plugin for Http
Source§fn id(&self) -> &'static str
fn id(&self) -> &'static str
Stable plugin identifier used for dependency checks and
crate::App::has_plugin. Read moreSource§fn meta(&self) -> PluginMeta
fn meta(&self) -> PluginMeta
Display name, description, and declared
PluginMeta::sdk version.Auto Trait Implementations§
impl Freeze for Http
impl RefUnwindSafe for Http
impl Send for Http
impl Sync for Http
impl Unpin for Http
impl UnsafeUnpin for Http
impl UnwindSafe for Http
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