mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-05 10:49:40 +02:00
Move ConnectConfig
to connect
This commit is contained in:
parent
1a7c440bd7
commit
cc9a574b2e
12 changed files with 137 additions and 175 deletions
|
@ -98,7 +98,10 @@ impl SpClient {
|
|||
let body = protobuf::text_format::print_to_string(message);
|
||||
|
||||
let mut headers = headers.unwrap_or_else(HeaderMap::new);
|
||||
headers.insert(CONTENT_TYPE, "application/protobuf".parse()?);
|
||||
headers.insert(
|
||||
CONTENT_TYPE,
|
||||
HeaderValue::from_static("application/protobuf"),
|
||||
);
|
||||
|
||||
self.request(method, endpoint, Some(headers), Some(body))
|
||||
.await
|
||||
|
@ -112,7 +115,7 @@ impl SpClient {
|
|||
body: Option<String>,
|
||||
) -> SpClientResult {
|
||||
let mut headers = headers.unwrap_or_else(HeaderMap::new);
|
||||
headers.insert(ACCEPT, "application/json".parse()?);
|
||||
headers.insert(ACCEPT, HeaderValue::from_static("application/json"));
|
||||
|
||||
self.request(method, endpoint, Some(headers), body).await
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue