diff --git a/examples/csrf_form_authentication.py b/examples/csrf_form_authentication.py new file mode 100644 index 0000000000..d15fd22e9e --- /dev/null +++ b/examples/csrf_form_authentication.py @@ -0,0 +1,29 @@ +from locust import HttpUser, between, task + +import re + + +class WebsiteUser(HttpUser): + host = "http://127.0.0.1:8089" + wait_time = between(2, 5) + + @task + def authenticate(self): + with self.client.get("/sign-in", catch_response=True) as response: + match = re.search( + r'