GET request, unwrap `ApiResponse` envelope.
(&self, path: &str)
| 91 | |
| 92 | /// GET request, unwrap `ApiResponse` envelope. |
| 93 | pub async fn get<T: DeserializeOwned>(&self, path: &str) -> Result<T, RemoteError> { |
| 94 | let url = format!("{}{}", self.base_url, path); |
| 95 | log::debug!("GET {}", url); |
| 96 | |
| 97 | let resp = self |
| 98 | .http |
| 99 | .get(&url) |
| 100 | .send() |
| 101 | .await |
| 102 | .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?; |
| 103 | |
| 104 | self.handle_response(resp).await |
| 105 | } |
| 106 | |
| 107 | /// POST request with JSON body, unwrap `ApiResponse` envelope. |
| 108 | pub async fn post<B: Serialize, T: DeserializeOwned>( |
nothing calls this directly
no test coverage detected