Add routes

This commit is contained in:
Dayamond
2025-10-21 17:18:00 +02:00
parent 42a98f3435
commit a7b9ce803b
5 changed files with 91 additions and 1 deletions
+51
View File
@@ -0,0 +1,51 @@
meta {
name: Login
type: http
seq: 4
}
post {
url: http://localhost:8000/api/users/login
body: json
auth: basic
}
headers {
X-XSRF-TOKEN: eyJpdiI6IjZaY0Y4aWtBMkxhWnlWQ2VpNDBhQWc9PSIsInZhbHVlIjoiWkF0N2lWTmlRSzdienZqREp0YUxPOFg0OE10bXZZME1QRitZRjV6bGs3QnZ0WUJVU1RkL0h0eDhPR1huODFuZzFHMDQxNzg4eDN4Ri91eVdFSDNVNUloSGZtRHd1aFd0TEF6MkxzOUhDMjRJeUxEYUcveEZHcVlzMnZha0Q1MkQiLCJtYWMiOiI0MDc2NzRmMjFiNDhjMDBjMWY4Yzc5Y2FjNTZhZWNkN2FkM2RmMzJlZDNmOWYwNDFhZWFlZGFmOGE4ZTA0Yzg0IiwidGFnIjoiIn0=
Accept: application/json
}
auth:basic {
username: test@test.com
password: test
}
body:json {
{
"email": "{{email}}",
"password": "{{password}}"
}
}
vars:pre-request {
email: test@test.com
password: test
xsrf: null
}
settings {
encodeUrl: true
timeout: 0
}
docs {
Permet de se connecter
Le header X-XSRF-TOKEN est obligatoire.
Pour le récupérer:
- Lancer la requête get CSR
- Prendre la valeur XSRF-TOKEN du Set-Cookie des Header
- Mettre la valeur dans le script extractCSRF.js
- Copier la valeur de retour
}
+4
View File
@@ -0,0 +1,4 @@
const c = "eyJpdiI6IjZaY0Y4aWtBMkxhWnlWQ2VpNDBhQWc9PSIsInZhbHVlIjoiWkF0N2lWTmlRSzdienZqREp0YUxPOFg0OE10bXZZME1QRitZRjV6bGs3QnZ0WUJVU1RkL0h0eDhPR1huODFuZzFHMDQxNzg4eDN4Ri91eVdFSDNVNUloSGZtRHd1aFd0TEF6MkxzOUhDMjRJeUxEYUcveEZHcVlzMnZha0Q1MkQiLCJtYWMiOiI0MDc2NzRmMjFiNDhjMDBjMWY4Yzc5Y2FjNTZhZWNkN2FkM2RmMzJlZDNmOWYwNDFhZWFlZGFmOGE4ZTA0Yzg0IiwidGFnIjoiIn0%3D";
const token = decodeURIComponent(c);
console.log(token);
+20
View File
@@ -0,0 +1,20 @@
meta {
name: get CSRF
type: http
seq: 3
}
get {
url: http://localhost:8000/sanctum/csrf-cookie
body: none
auth: inherit
}
assert {
res.status: eq 204
}
settings {
encodeUrl: true
timeout: 0
}
+1 -1
View File
@@ -1,7 +1,7 @@
meta { meta {
name: hello name: hello
type: http type: http
seq: 1 seq: 2
} }
get { get {
+15
View File
@@ -0,0 +1,15 @@
meta {
name: me
type: http
seq: 5
}
get {
url: http://localhost:8000/api/me
body: none
auth: inherit
}
settings {
encodeUrl: true
}