-1

I'm 'leaning' locust and I need to use it to swarm a website. but I don't know what format my post request should be. here is a photo of payload in an example

_csrf: longToken==
Login[username]: username
Login[password]: password
Login[rememberMe]: 0

I have tried this:

self.client.post("/user/auth/login", headers={"_crf":tok},json={"_crf":tok,"Login[username]":"username", "Login[password]":"password","Login[rememberMe]":"0"})

but it responds with bad request 400, no idea what to do

Cyberwiz
  • 11,027
  • 3
  • 20
  • 40

1 Answers1

-1

Because you’re specifying some headers explicitly, you may also need to set ”accept”: ”text/json” and ”content-type”: ”text/json” headers.

If that doesnt help, you can print the exact payload sent using https://docs.locust.io/en/stable/running-in-debugger.html#print-http-communication

Cyberwiz
  • 11,027
  • 3
  • 20
  • 40