I made a small prototype for my program in Python, in which I need to log in to a website. For doing that I did:
import requests as req
session = req.Session()
req.post("somesite.com", data={"procedure": "login", "username": "JohnSmith", "password": "hunter7"})
And all of my API calls later worked well.
However, in Rust (using ureq), I can't seem to accomplish that. This is my code:
let agent = ureq::Agent::new();
agent.post("somesite.com")
.query("procedure", "login")
.query("username", "JohnSmith")
.query("password", "hunter7")
.call().unwrap();
I have checked and in the Rust version there isn't any session cookie, unlike in the Python version.