Module Import alias Import alias ImportFrom alias ImportFrom alias alias Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias alias alias Import alias ImportFrom alias alias Assign NameStore Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body If BoolOpAnd Call NameLoad NameLoad Str AttributeLoad NameLoad attr body Raise AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr If BoolOpAnd AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body AugAssignAdd NameStore BinOpMod Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad TupleLoad AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call AttributeLoad NameLoad attr NameLoad body Return NameLoad orelse Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Dict Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index Str Call NameLoad BinOpMult BinOpSub Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Num Assign SubscriptStore NameLoad Index Str BoolOpOr NameLoad AttributeLoad AttributeLoad BoolOpOr BoolOpAnd AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad attr attr If Call AttributeLoad NameLoad attr Str NameLoad body Assign SubscriptStore NameLoad Index Str Call NameLoad BoolOpOr Call AttributeLoad AttributeLoad NameLoad attr attr Str Num orelse Assign SubscriptStore NameLoad Index Str Call NameLoad BoolOpOr AttributeLoad NameLoad attr Str If NameLoad body Assign AttributeStore NameLoad attr NameLoad Return Call NameLoad NameLoad orelse TryExcept body Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword NameLoad orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body Expr Str TryExcept body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad NameLoad body Raise ExceptHandler type NameLoad name NameStore body Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If AttributeLoad NameLoad attr body Return CompareIs NameLoad NameLoad If NameLoad body If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Return NameLoad orelse TryExcept body Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr name NameStore body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword SubscriptLoad AttributeLoad NameLoad attr Index Str keyword SubscriptLoad AttributeLoad NameLoad attr Index Str keyword SubscriptLoad AttributeLoad NameLoad attr Index Str keyword SubscriptLoad AttributeLoad NameLoad attr Index Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword SubscriptLoad AttributeLoad NameLoad attr Index Str keyword SubscriptLoad AttributeLoad NameLoad attr Index Str keyword SubscriptLoad AttributeLoad NameLoad attr Index Str keyword NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list
N/A N/A re N/A time datetime timedelta urlparse urlparse urlunparse N/A requests requests Response Request requests.auth HTTPBasicAuth requests.exceptions RequestException MissingSchema InvalidSchema InvalidURL N/A events exception CatchResponseError ResponseError N/A absolute_http_url_regexp N/A N/A re compile ^https?:// N/A re I LocustResponse N/A Response N/A raise_for_status N/A N/A self N/A N/A N/A N/A N/A hasattr self error N/A self error N/A N/A N/A self error N/A N/A N/A Response raise_for_status self N/A N/A HttpSession N/A N/A requests Session N/A N/A 
    Class for performing web requests and holding (session-) cookies between requests (in order
    to be able to log in and out of websites). Each request is logged so that locust can display 
    statistics.
    
    This is a slightly extended version of `python-request <http://python-requests.org>`_'s
    :py:class:`requests.Session` class and mostly this class works exactly the same. However 
    the methods for making requests (get, post, delete, put, head, options, patch, request) 
    can now take a *url* argument that's only the path part of the URL, in which case the host 
    part of the URL will be prepended with the HttpSession.base_url which is normally inherited
    from a Locust class' host property.
    
    Each of the methods for making requests also takes two additional optional arguments which 
    are Locust specific and doesn't exist in python-requests. These are:
    
    :param name: (optional) An argument that can be specified to use as label in Locust's statistics instead of the URL path. 
                 This can be used to group different URL's that are requested into a single entry in Locust's statistics.
    :param catch_response: (optional) Boolean argument that, if set, can be used to make a request return a context manager 
                           to work as argument to a with statement. This will allow the request to be marked as a fail based on the content of the 
                           response, even if the response code is ok (2xx). The opposite also works, one can use catch_response to catch a request
                           and then mark it as successful even if the response code was not (i.e 500 or 404).
     __init__ N/A N/A self base_url N/A args kwargs N/A N/A N/A N/A N/A requests Session __init__ self args kwargs N/A N/A self base_url base_url N/A parsed_url N/A urlparse N/A self base_url N/A N/A N/A parsed_url username N/A parsed_url password N/A N/A netloc N/A parsed_url hostname N/A N/A parsed_url port N/A N/A netloc N/A :%d N/A parsed_url port N/A N/A self base_url N/A urlunparse N/A N/A parsed_url scheme netloc N/A parsed_url path N/A parsed_url params N/A parsed_url query N/A parsed_url fragment N/A N/A self auth N/A HTTPBasicAuth N/A parsed_url username N/A parsed_url password N/A _build_url N/A N/A self path N/A N/A N/A  prepend url with hostname unless it's already an absolute URL  N/A N/A N/A absolute_http_url_regexp match path N/A N/A path N/A N/A N/A %s%s N/A N/A self base_url path N/A request N/A N/A self method url name catch_response N/A None False kwargs N/A N/A 
        Constructs and sends a :py:class:`requests.Request`.
        Returns :py:class:`requests.Response` object.

        :param method: method for the new :class:`Request` object.
        :param url: URL for the new :class:`Request` object.
        :param name: (optional) An argument that can be specified to use as label in Locust's statistics instead of the URL path. 
          This can be used to group different URL's that are requested into a single entry in Locust's statistics.
        :param catch_response: (optional) Boolean argument that, if set, can be used to make a request return a context manager 
          to work as argument to a with statement. This will allow the request to be marked as a fail based on the content of the 
          response, even if the response code is ok (2xx). The opposite also works, one can use catch_response to catch a request
          and then mark it as successful even if the response code was not (i.e 500 or 404).
        :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`.
        :param data: (optional) Dictionary or bytes to send in the body of the :class:`Request`.
        :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`.
        :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`.
        :param files: (optional) Dictionary of ``'filename': file-like-objects`` for multipart encoding upload.
        :param auth: (optional) Auth tuple or callable to enable Basic/Digest/Custom HTTP Auth.
        :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, 
            or a (`connect timeout, read timeout <user/advanced.html#timeouts>`_) tuple.
        :type timeout: float or tuple
        :param allow_redirects: (optional) Set to True by default.
        :type allow_redirects: bool
        :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.
        :param stream: (optional) whether to immediately download the response content. Defaults to ``False``.
        :param verify: (optional) if ``True``, the SSL cert will be verified. A CA_BUNDLE path can also be provided.
        :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair.
         N/A url N/A N/A self _build_url url N/A request_meta N/A N/A N/A request_meta N/A method method N/A N/A request_meta N/A start_time N/A N/A time time N/A response N/A N/A self _send_request_safe_mode method url kwargs N/A N/A request_meta N/A response_time N/A int N/A N/A N/A N/A time time N/A request_meta N/A start_time 1000 N/A N/A request_meta N/A name N/A name N/A N/A N/A N/A N/A response history N/A N/A response history N/A 0 response request path_url N/A N/A N/A kwargs get stream False N/A N/A N/A request_meta N/A content_size N/A int N/A N/A N/A N/A response headers get content-length 0 N/A N/A N/A request_meta N/A content_size N/A len N/A N/A response content N/A catch_response N/A N/A N/A response locust_request_meta request_meta N/A N/A ResponseContextManager response N/A N/A N/A N/A N/A N/A response raise_for_status N/A N/A N/A RequestException N/A e N/A N/A N/A N/A N/A events request_failure fire request_type N/A request_meta N/A method name N/A request_meta N/A name response_time N/A request_meta N/A response_time exception e N/A N/A N/A N/A N/A events request_success fire request_type N/A request_meta N/A method name N/A request_meta N/A name response_time N/A request_meta N/A response_time response_length N/A request_meta N/A content_size N/A response N/A _send_request_safe_mode N/A N/A self method url N/A kwargs N/A N/A 
        Send an HTTP request, and catch any exception that might occur due to connection problems.
        
        Safe mode has been removed from requests 1.x.
         N/A N/A N/A N/A N/A N/A requests Session request self method url kwargs N/A N/A N/A N/A MissingSchema InvalidSchema InvalidURL N/A N/A N/A N/A RequestException N/A e N/A N/A r N/A LocustResponse N/A N/A r error e N/A N/A r status_code 0 N/A N/A r request N/A N/A N/A Request method url prepare N/A r N/A N/A ResponseContextManager N/A LocustResponse N/A N/A 
    A Response class that also acts as a context manager that provides the ability to manually 
    control if an HTTP request should be marked as successful or a failure in Locust's statistics
    
    This class is a subclass of :py:class:`Response <requests.Response>` with two additional 
    methods: :py:meth:`success <locust.clients.ResponseContextManager.success>` and 
    :py:meth:`failure <locust.clients.ResponseContextManager.failure>`.
     N/A _is_reported False __init__ N/A N/A self response N/A N/A N/A N/A self __dict__ N/A response __dict__ N/A __enter__ N/A N/A self N/A N/A N/A self N/A __exit__ N/A N/A self exc value traceback N/A N/A N/A N/A self _is_reported N/A N/A N/A exc None N/A exc N/A N/A N/A isinstance value ResponseError N/A N/A N/A N/A self failure value N/A N/A False N/A N/A N/A N/A N/A N/A self raise_for_status N/A N/A N/A N/A N/A requests exceptions RequestException N/A e N/A N/A N/A N/A self failure e N/A N/A N/A N/A self success N/A True N/A success N/A N/A self N/A N/A N/A 
        Report the response as successful
        
        Example::
        
            with self.client.get("/does/not/exist", catch_response=True) as response:
                if response.status_code == 404:
                    response.success()
         N/A N/A N/A N/A events request_success fire request_type N/A N/A self locust_request_meta N/A method name N/A N/A self locust_request_meta N/A name response_time N/A N/A self locust_request_meta N/A response_time response_length N/A N/A self locust_request_meta N/A content_size N/A N/A self _is_reported True N/A failure N/A N/A self exc N/A N/A N/A 
        Report the response as a failure.
        
        exc can be either a python exception, or a string in which case it will
        be wrapped inside a CatchResponseError. 
        
        Example::
        
            with self.client.get("/", catch_response=True) as response:
                if response.content == "":
                    response.failure("No data")
         N/A N/A isinstance exc basestring N/A N/A exc N/A CatchResponseError exc N/A N/A N/A N/A events request_failure fire request_type N/A N/A self locust_request_meta N/A method name N/A N/A self locust_request_meta N/A name response_time N/A N/A self locust_request_meta N/A response_time exception exc N/A N/A self _is_reported True N/A N/A