Tester Sentry avec une requête cURL
C’est seulement un test rapide pour comprendre comment Sentry fonctionne pour envoyer des erreurs.
curl --location --request POST 'https://<PUBLIC_KEY>@<BASE_URI>/api/<PROJECT_ID>/store/' \
--header 'X-Sentry-Auth: Sentry sentry_version=7,sentry_key=<PUBLIC_KEY>,sentry_client=raven-bash/0.1' \
--header 'Content-Type: application/json' \
--data-raw '{
"message":"Hello World"
}'
Pour connaitre les informations :
Allez à https://sentry.io/settings/<votre-organisation>/projects/<votre-projet>/keys/
puis cliquer sur configure en bas de la page vous allez voir toutes les informations.
- PUBLIC_KEY: La clé est la string devant le @
- PROJECT_ID: Voir en bas de la page
- BASE_URI: l’URL après le @
Vous n’avez pas besoin de la
secret key
.
Tester les accès
J’utilise Postman pour faire le test.
Origin: *
Le test de postman a fonctionné sans problème.
Origin: webuxlab.com
Le test de postman a fonctionné sans problème.