diff --git a/locust/clients.py b/locust/clients.py index 87cb8a1dde..307d267cb1 100644 --- a/locust/clients.py +++ b/locust/clients.py @@ -107,6 +107,7 @@ def request(self, method, url, name=None, catch_response=False, **kwargs): request_meta = {} # set up pre_request hook for attaching meta data to the request object + request_meta["method"] = method request_meta["start_time"] = time.time() response = self._send_request_safe_mode(method, url, **kwargs) @@ -114,7 +115,7 @@ def request(self, method, url, name=None, catch_response=False, **kwargs): # record the consumed time request_meta["response_time"] = int((time.time() - request_meta["start_time"]) * 1000) - request_meta["method"] = response.request.method + request_meta["name"] = name or (response.history and response.history[0] or response).request.path_url # get the length of the content, but if the argument stream is set to True, we take