MCPcopy Create free account
hub / github.com/bajrangCoder/setu / parses_explicit_method

Function parses_explicit_method

src/utils/curl_parser.rs:413–417  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

411 let cmd = r#"curl -X POST 'https://api.example.com/users' \
412 -H 'Content-Type: application/json' \
413 -H 'Accept: application/json' \
414 -d '{"name":"alice"}'"#;
415 let parsed = parse_curl(cmd).unwrap();
416 assert_eq!(parsed.method, HttpMethod::Post);
417 assert_eq!(parsed.url, "https://api.example.com/users");
418 assert_eq!(parsed.headers.len(), 2);
419 match &parsed.body {
420 RequestBody::Json(s) => assert_eq!(s, r#"{"name":"alice"}"#),

Callers

nothing calls this directly

Calls 1

parse_curlFunction · 0.85

Tested by

no test coverage detected