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

Function parses_user_provided_complex_curl

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

Source from the content-addressed store, hash-verified

572 }
573 }
574 }
575 ],
576 "id": "18e78361",
577 "regs": {
578 "ext": {
579 "gdpr": 1
580 }
581 }
582}'"#;
583 let parsed = parse_curl(cmd).unwrap();
584 assert_eq!(parsed.method, HttpMethod::Post);
585 assert_eq!(parsed.url, "https://ssp.veonadx.com/bid/prebid");
586 assert_eq!(parsed.headers.len(), 1);
587 assert_eq!(parsed.headers[0].key, "Content-Type");
588 assert_eq!(parsed.headers[0].value, "application/json");
589 match parsed.body {
590 RequestBody::Json(s) => {
591 assert!(s.contains("\"imp\""));
592 assert!(s.contains("\"gdpr\""));
593 }
594 other => panic!("expected JSON body, got {:?}", other),
595 }
596 }
597}

Callers

nothing calls this directly

Calls 1

parse_curlFunction · 0.85

Tested by

no test coverage detected