GET request, unwrap `ApiResponse` envelope.
(&self, path: &str)
| 116 | |
| 117 | /// GET request, unwrap `ApiResponse` envelope. |
| 118 | pub async fn get<T: DeserializeOwned>(&self, path: &str) -> Result<T, RemoteError> { |
| 119 | let url = format!("{}{}", self.base_url, path); |
| 120 | log::debug!("GET {}", url); |
| 121 | |
| 122 | let resp = self |
| 123 | .http |
| 124 | .get(&url) |
| 125 | .send() |
| 126 | .await |
| 127 | .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?; |
| 128 | |
| 129 | self.handle_response(resp).await |
| 130 | } |
| 131 | |
| 132 | /// POST request with JSON body, unwrap `ApiResponse` envelope. |
| 133 | pub async fn post<B: Serialize, T: DeserializeOwned>( |
nothing calls this directly
no test coverage detected