pub struct HttpService { /* private fields */ }Expand description
Shared reqwest::Client for outbound HTTP (inject where needed).
Implementations§
Source§impl HttpService
impl HttpService
Sourcepub fn from_options(options: &HttpServiceOptions) -> Self
pub fn from_options(options: &HttpServiceOptions) -> Self
Build a service from explicit options.
Sourcepub fn client(&self) -> &Client
pub fn client(&self) -> &Client
Borrow the underlying reqwest::Client. Most callers won’t need this
— the typed wrapper exposes every operation we ship — but advanced
users (custom middleware, retry policies, interceptors) can drop down.
Sourcepub fn get(&self, url: impl IntoUrl) -> RequestBuilder
pub fn get(&self, url: impl IntoUrl) -> RequestBuilder
Start a GET request to url.
Sourcepub fn post(&self, url: impl IntoUrl) -> RequestBuilder
pub fn post(&self, url: impl IntoUrl) -> RequestBuilder
Start a POST request to url.
Sourcepub fn put(&self, url: impl IntoUrl) -> RequestBuilder
pub fn put(&self, url: impl IntoUrl) -> RequestBuilder
Start a PUT request to url.
Sourcepub fn patch(&self, url: impl IntoUrl) -> RequestBuilder
pub fn patch(&self, url: impl IntoUrl) -> RequestBuilder
Start a PATCH request to url.
Sourcepub fn delete(&self, url: impl IntoUrl) -> RequestBuilder
pub fn delete(&self, url: impl IntoUrl) -> RequestBuilder
Start a DELETE request to url.
Trait Implementations§
Source§impl Debug for HttpService
impl Debug for HttpService
Source§impl Injectable for HttpService
impl Injectable for HttpService
fn construct(_registry: &ProviderRegistry) -> Arc<Self> ⓘ
Source§fn scope() -> ProviderScope
fn scope() -> ProviderScope
Provider scope used when the module registers this type.
fn on_module_init<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_module_destroy<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_application_bootstrap<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Source§fn on_before_application_shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_before_application_shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
NestJS
beforeApplicationShutdown: fires before on_application_shutdown /
on_module_destroy during graceful shutdown. Use to flush caches, close
long-lived connections, or release resources while dependents are still alive.fn on_application_shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for HttpService
impl !UnwindSafe for HttpService
impl Freeze for HttpService
impl Send for HttpService
impl Sync for HttpService
impl Unpin for HttpService
impl UnsafeUnpin for HttpService
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