Тема: Submiting two url requests

Hi,

I'm developing a Ajax page that requests two urls. The first is a POST request and the second is a GET request.
I'm using time as a method between requests because the the GET request is only valid after the POST is made.

My questions are:
Is there any better way to start the GET request after POST without being time?

How to obtain all the info from the POST request (cookie, headers, etc) and made available with the GET request?
This is for the server to reconize the POST and GET coming from the same machine, user and browser.

Thanks

2 Востаннє редагувалося mikeos (27.10.2018 11:39:09)

Re: Submiting two url requests

Learn Promises in JS
https://developer.mozilla.org/en/docs/W … ts/Promise

E.g.:

    fetch('url-1')
        .then(response => {
            fetch('url-2').then(...)
        })