Extracts and returns the content text and content type from a HAR response.
(har_response: Dict[str, Any])
| 79 | |
| 80 | |
| 81 | def format_response(har_response: Dict[str, Any]) -> Dict[str, str]: |
| 82 | """ |
| 83 | Extracts and returns the content text and content type from a HAR response. |
| 84 | """ |
| 85 | content = har_response.get("content", {}) |
| 86 | return { |
| 87 | "text": content.get("text", ""), |
| 88 | "type": content.get("mimeType", "") |
| 89 | } |
| 90 | |
| 91 | |
| 92 | def parse_har_file(har_file_path: str) -> Dict[Request, Dict[str, str]]: |