(self, testcase_dict, entry_json)
parse HAR entry request headers, and make testcase headers.
parse HAR entry request headers, and make testcase headers.
parse HAR entry request headers and make testcase headers .
def _make_har_request_headers(self, testcase_dict, entry_json):
        """ parse HAR entry request headers, and make testcase headers.
        """
        testcase_headers = []
        for header in entry_json["request"].get("header", []):
            if header["name"].lower() in self.IGNORE_REQUEST_HEADERS:
                continue
            if header["name"].lower() == "user-agent":
                if not self.user_agent:
                    self.user_agent = header["value"]
                continue
            testcase_headers.append({'key': header["name"], 'value': header["value"]})

        testcase_dict["header"] = json.dumps(testcase_headers)
def _make_har_request_headers ( self , testcase_dict , entry_json ) : testcase_headers = [ ] for header in entry_json [ "request" ] . get ( "header" , [ ] ) : if header [ "name" ] . lower ( ) in self . IGNORE_REQUEST_HEADERS : continue if header [ "name" ] . lower ( ) == "user-agent" : if not self . user_agent : self . user_agent = header [ "value" ] continue testcase_headers . append ( { 'key' : header [ "name" ] , 'value' : header [ "value" ] } ) testcase_dict [ "header" ] = json . dumps ( testcase_headers )