(&mut self, request: &SignupRequest)
| 155 | #[async_trait(?Send)] |
| 156 | impl Service for CloudService { |
| 157 | async fn signup(&mut self, request: &SignupRequest) -> io::Result<()> { |
| 158 | let response = self |
| 159 | .client |
| 160 | .post(self.make_url("api/signup")) |
| 161 | .headers(self.default_headers()) |
| 162 | .header("Content-Type", "application/json") |
| 163 | .body(serde_json::to_vec(&request)?) |
| 164 | .send() |
| 165 | .await |
| 166 | .map_err(reqwest_error_to_io_error)?; |
| 167 | match response.status() { |
| 168 | StatusCode::OK => Ok(()), |
| 169 | _ => Err(http_response_to_io_error(response).await), |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | async fn login(&mut self, username: &str, password: &str) -> io::Result<LoginResponse> { |
| 174 | // TODO(https://github.com/seanmonstar/reqwest/pull/1096): Replace with a basic_auth() |
no test coverage detected