(
&mut self,
username: &str,
filename: &str,
content: Vec<u8>,
)
| 303 | } |
| 304 | |
| 305 | async fn patch_file_content( |
| 306 | &mut self, |
| 307 | username: &str, |
| 308 | filename: &str, |
| 309 | content: Vec<u8>, |
| 310 | ) -> io::Result<()> { |
| 311 | let auth_data = self.auth_data.borrow(); |
| 312 | |
| 313 | let response = self |
| 314 | .client |
| 315 | .patch(self.make_url(&format!("api/users/{}/files/{}", username, filename))) |
| 316 | .headers(self.default_headers()) |
| 317 | .header("Content-Type", "application/octet-stream") |
| 318 | .header("X-EndBASIC-PatchContent", "true") |
| 319 | .body(content) |
| 320 | .bearer_auth(Self::require_auth_data(auth_data.as_ref())?.access_token.as_str()) |
| 321 | .send() |
| 322 | .await |
| 323 | .map_err(reqwest_error_to_io_error)?; |
| 324 | match response.status() { |
| 325 | StatusCode::OK | StatusCode::CREATED => Ok(()), |
| 326 | _ => Err(http_response_to_io_error(response).await), |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | async fn patch_file_acls( |
| 331 | &mut self, |
no test coverage detected