Reputation: 21
Sorry if this has been asking already but I cannot seem to find a straight answer.
I need to post data to one API endpoint that returns a token. I then need to use that token in a header to make a separate GET request to another endpoint to return the data I want.
The tokens are only good for a few minutes so if the GET endpoint responds token invalid it will send another POST request to get a new token and start the process all over.
I have been trying multiple async methods, promises, etc without luck. Thank you in advance.
Upvotes: 0
Views: 43