pub struct SpotifyApi { /* private fields */ }Expand description
Spotify Web API client.
Makes authenticated HTTP requests to the Spotify API. All methods require a valid access token.
Implementations§
Source§impl SpotifyApi
impl SpotifyApi
Sourcepub fn with_base_url(access_token: String, base_url: String) -> Self
pub fn with_base_url(access_token: String, base_url: String) -> Self
Create a new API client with a custom base URL.
Useful for testing with mock servers or connecting to alternative endpoints.
Sourcepub async fn post(&self, path: &str) -> Result<Option<Value>, HttpError>
pub async fn post(&self, path: &str) -> Result<Option<Value>, HttpError>
Make a POST request without body.
Sourcepub async fn post_json(
&self,
path: &str,
body: &Value,
) -> Result<Option<Value>, HttpError>
pub async fn post_json( &self, path: &str, body: &Value, ) -> Result<Option<Value>, HttpError>
Make a POST request with JSON body.
Sourcepub async fn put(&self, path: &str) -> Result<Option<Value>, HttpError>
pub async fn put(&self, path: &str) -> Result<Option<Value>, HttpError>
Make a PUT request without body.
Sourcepub async fn put_json(
&self,
path: &str,
body: &Value,
) -> Result<Option<Value>, HttpError>
pub async fn put_json( &self, path: &str, body: &Value, ) -> Result<Option<Value>, HttpError>
Make a PUT request with JSON body.
Auto Trait Implementations§
impl Freeze for SpotifyApi
impl !RefUnwindSafe for SpotifyApi
impl Send for SpotifyApi
impl Sync for SpotifyApi
impl Unpin for SpotifyApi
impl !UnwindSafe for SpotifyApi
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