I'm trying to do something simple:
post http://localhost:3001/api/v1/auth HTTP/1.1
Content-Type: application/json
{
"username": "name",
"password" : "password"
}
This sends me an authorisation token which I want to use in future calls.
I understand how to update .vscode/settings.json to store environment variables but I want to store the auth token I've just received.
Ok so you reference a previous API call. Documentation is ... limited. If anyone has thoughts on long-time storage of the token so calls aren't made constantly, that would be great.
### login
# @name postLogin
post http://localhost:3001/api/v1/auth HTTP/1.1
Content-Type: application/json
{
"username": "name",
"password" : "password"
}
@token = {{postLogin.response.body.apptoken}}
### Get Profile details
get {{hostname}}/profile
Authorization: Bearer {{token}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With