<- Test Directory

Login with Basic Auth

Login to your site or API using basic authentication


You can easily login using Basic Authentication with any LoadForge request by adding the auth parameter to your get or post request object. In this example below, we will try to login as user1 with password password1.

We have two examples, one POST request with data and another GET request with just authentication.


import time
from locust import HttpUser, task, between

class QuickstartUser(HttpUser):
    wait_time = between(3, 5)

        self.client.get("/myUrl", auth=("user1", "password1"))
                         {"item": "123", "button": "submit"}, 
                         auth=("user1", "password1")

This guide is part of the LoadForge Directory, an index of locustfile's for use with LoadForge website and API load tests. We also provide a wizard to generate tests, and onboarding assistance for clients. Contact us should you have any questions.

LoadForge provides load testing and stress tests for websites, APIs and servers. It uses your cloud account to rapidly scale large numbers of simulated users to load test your website, store, API, or application for cheap - just cents per test!

For more help on Tests please see our official documentation. Logged in users can also use our wizard to generate a locustfile, or you can record your browser steps.

Ready to run your test?
Start your first test within minutes.