pub struct HttpClient {Show 14 fields
pub api_url: Uri,
pub http_client: HttpClient,
pub x_plex_provides: String,
pub x_plex_platform: String,
pub x_plex_platform_version: String,
pub x_plex_product: String,
pub x_plex_version: String,
pub x_plex_device: String,
pub x_plex_device_name: String,
pub x_plex_client_identifier: String,
pub x_plex_sync_version: String,
pub x_plex_model: String,
pub x_plex_features: String,
pub x_plex_target_client_identifier: String,
/* private fields */
}Fields§
§api_url: Uri§http_client: HttpClient§x_plex_provides: StringX-Plex-Provides header value. Comma-separated list.
Should be one or more of controller, server, sync-target, player.
x_plex_platform: StringX-Plex-Platform header value.
Platform name, e.g. iOS, macOS, etc.
x_plex_platform_version: StringX-Plex-Platform-Version header value.
OS version, e.g. 4.3.1
x_plex_product: StringX-Plex-Product header value.
Application name, e.g. Laika, Plex Media Server, Media Link.
x_plex_version: StringX-Plex-Version header value.
Application version, e.g. 10.6.7.
x_plex_device: StringX-Plex-Device header value.
Device name and model number, e.g. iPhone3,2, Motorola XOOM™, LG5200TV.
x_plex_device_name: StringX-Plex-Device-Name header value.
Primary name for the device, e.g. “Plex Web (Chrome)”.
x_plex_client_identifier: StringX-Plex-Client-Identifier header value.
UUID, serial number, or other number unique per device.
N.B. Should be unique for each of your devices.
x_plex_sync_version: StringX-Plex-Sync-Version header value.
Not sure what are the valid values, but at the time of writing Plex Web sends 2 here.
x_plex_model: StringX-Plex-Model header value.
Plex Web sends hosted
x_plex_features: StringX-Plex-Features header value.
Looks like it’s a replacement for X-Plex-Provides
x_plex_target_client_identifier: StringX-Plex-Target-Client-Identifier header value.
Used when proxying a client request via a server.
Implementations§
Source§impl HttpClient
impl HttpClient
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Verifies that this client has an authentication token.
Sourcepub fn post<T>(&self, path: T) -> RequestBuilder<'_, T>
pub fn post<T>(&self, path: T) -> RequestBuilder<'_, T>
Begins building a request using the HTTP POST method.
Sourcepub fn postm<T>(&self, path: T) -> RequestBuilder<'_, T>
pub fn postm<T>(&self, path: T) -> RequestBuilder<'_, T>
Does the same as HttpClient::post(), but appends only bare minimum
headers: X-Plex-Client-Identifier and X-Plex-Token.
Sourcepub fn head<T>(&self, path: T) -> RequestBuilder<'_, T>
pub fn head<T>(&self, path: T) -> RequestBuilder<'_, T>
Begins building a request using the HTTP HEAD method.
Sourcepub fn get<T>(&self, path: T) -> RequestBuilder<'_, T>
pub fn get<T>(&self, path: T) -> RequestBuilder<'_, T>
Begins building a request using the HTTP GET method.
Sourcepub fn getm<T>(&self, path: T) -> RequestBuilder<'_, T>
pub fn getm<T>(&self, path: T) -> RequestBuilder<'_, T>
Does the same as HttpClient::get(), but appends only bare minimum
headers: X-Plex-Client-Identifier and X-Plex-Token.
Sourcepub fn put<T>(&self, path: T) -> RequestBuilder<'_, T>
pub fn put<T>(&self, path: T) -> RequestBuilder<'_, T>
Begins building a request using the HTTP PUT method.
Sourcepub fn putm<T>(&self, path: T) -> RequestBuilder<'_, T>
pub fn putm<T>(&self, path: T) -> RequestBuilder<'_, T>
Does the same as HttpClient::put(), but appends only bare minimum
headers: X-Plex-Client-Identifier and X-Plex-Token.
Sourcepub fn delete<T>(&self, path: T) -> RequestBuilder<'_, T>
pub fn delete<T>(&self, path: T) -> RequestBuilder<'_, T>
Begins building a request using the HTTP DELETE method.
Sourcepub fn deletem<T>(&self, path: T) -> RequestBuilder<'_, T>
pub fn deletem<T>(&self, path: T) -> RequestBuilder<'_, T>
Does the same as HttpClient::delete(), but appends only bare minimum
headers: X-Plex-Client-Identifier and X-Plex-Token.
Sourcepub fn set_x_plex_token<T>(self, x_plex_token: T) -> Selfwhere
T: Into<SecretString>,
pub fn set_x_plex_token<T>(self, x_plex_token: T) -> Selfwhere
T: Into<SecretString>,
Set the client’s authentication token.
Sourcepub fn x_plex_token(&self) -> &str
pub fn x_plex_token(&self) -> &str
Get a reference to the client’s authentication token.
Trait Implementations§
Source§impl Clone for HttpClient
impl Clone for HttpClient
Source§fn clone(&self) -> HttpClient
fn clone(&self) -> HttpClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more