-1

I am trying to login on a website by use method requests POST.

ssn = requests.session()
data = {"LoginForm[email]":"gmail@gmail.com", "LoginForm[password]":"pw12345", "LoginForm[rememberMe]":0}
r = ssn.post("https://www.fshare.vn/site/login", data = data)
print(r.json)

# bound method Response.json of <Response [400]>

as I know, I missing a value in data is called "csrf-app" : HTTP Header POST : _csrf-app=gXvuYHZnQpoA37zC1Yncpb1BMstVUqRcVdj9x1QHJqK1AoYoHlUV21G9jaya0Jjy9iJRrz1_nRIft4ywO0RD-g==&LoginForm[email]=gmail@gmail.com&LoginForm[password]=pw12345&LoginForm[rememberMe]=0

So how to get this value ""csrf-app" to post that along the other data ?

J. Murray
  • 1,460
  • 11
  • 19

1 Answers1

0

CSRF is used to avoid someone calling the APIs without the form. You can refer to this post for more information. You should instead look for their login REST APIs, and see if they have any.

Saurabh Sangwan
  • 417
  • 2
  • 6