MCPcopy Index your code
hub / github.com/clearloop/leetcode-cli / send

Method send

src/plugins/leetcode.rs:304–321  ·  view source on GitHub ↗
(self, client: &Client)

Source from the content-addressed store, hash-verified

302
303 impl Req {
304 pub async fn send(self, client: &Client) -> Result<Response, Error> {
305 trace!("Running leetcode::{}...", &self.name);
306 if self.info {
307 info!("{}", &self.name);
308 }
309 let url = self.url.to_owned();
310 let headers = LeetCode::headers(
311 self.default_headers,
312 vec![("Referer", &self.refer.unwrap_or(url))],
313 )?;
314
315 let req = match self.mode {
316 Mode::Get => client.get(&self.url),
317 Mode::Post => client.post(&self.url).json(&self.json),
318 };
319
320 Ok(req.headers(headers).send().await?)
321 }
322 }
323}

Callers 7

get_category_problemsMethod · 0.80
get_user_infoMethod · 0.80
get_question_dailyMethod · 0.80
get_question_detailMethod · 0.80
run_codeMethod · 0.80
verify_resultMethod · 0.80

Calls 1

headersMethod · 0.80

Tested by

no test coverage detected