Help to send data by python post method

Asked

Viewed 99 times

-2

I’m making a Checker for studies, I have a login api, but I keep coming up with this error:

<Response [403]>

I also tried to request post by Postman and gave the following error:

{
"sucesso": false,
"msg": "400 Bad Request: The browser (or proxy) sent a request that this server could not understand."
}

With the following settings in Postman: inserir a descrição da imagem aqui inserir a descrição da imagem aqui

import requests
import json

post_context_data = {
    "email": "[email protected]",
    "senha": "21312321321",
    "session": {},
}

headers_context_data = {
    "User-Agente": 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36',
    "content-type": "application/json;charset=UTF-8",
    "accept-encoding": "gzip, deflate, br",
    "accept": "application/json, text/plain, */*",
}
api_sender = requests.session()
json_content = api_sender.post("https://servicespub.prod.api.aws.**********.com.br/login/v1/usuario/login", data=json.dumps(post_context_data), headers=headers_context_data)
print(json_content)

The "Session" it generates in the cookie: inserir a descrição da imagem aqui I don’t know how I get a specific cookie from the site?

In Burpsuite I can make the answer come, follow some invalid and valid login prints. inserir a descrição da imagem aqui inserir a descrição da imagem aqui

1 answer

-3

403 - Forbidden is an error that occurs when something is wrong in the request, usually. For example: when a website detects that what you are sending to it may be dangerous to the site it returns 403, as if it ignored it for being insecure. This may be some authenticator of the site. It is not an error in the code, but in what you are sending.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.