MCPcopy Create free account
hub / github.com/Integuru-AI/Integuru / build_url_to_req_res_map

Function build_url_to_req_res_map

integuru/util/har_processing.py:115–129  ·  view source on GitHub ↗

Builds a dictionary mapping URLs to {'request': formatted_request, 'response': response_dict}

(req_res_dict: Dict[Request, Dict[str, str]])

Source from the content-addressed store, hash-verified

113
114
115def build_url_to_req_res_map(req_res_dict: Dict[Request, Dict[str, str]]) -> Dict[str, Dict[str, Any]]:
116 """
117 Builds a dictionary mapping URLs to {'request': formatted_request, 'response': response_dict}
118 """
119 url_to_req_res_dict = {}
120
121 for request, response in req_res_dict.items():
122 url = request.url
123 # If multiple requests to the same URL, you can choose to overwrite or store all
124 url_to_req_res_dict[url] = {
125 'request': request,
126 'response': response
127 }
128
129 return url_to_req_res_dict
130
131
132def get_har_urls(har_file_path: str) -> List[Tuple[str, str, str, str]]:

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected