17 lines
349 B
JavaScript
17 lines
349 B
JavaScript
|
|
|
|
async function testLogin() {
|
|
const res = await fetch("http://127.0.0.1:8000/api/auth/login", {
|
|
method: "POST",
|
|
headers: {
|
|
"Content-Type": "application/x-www-form-urlencoded",
|
|
},
|
|
body: "username=nurse%40hospital.com&password=password123",
|
|
});
|
|
|
|
console.log(res.status);
|
|
console.log(await res.text());
|
|
}
|
|
|
|
testLogin();
|