I'm using web requests to interact with the Qlik Sense QRS API.
All my "GET" requests are workings, with headers and parameters.
When I'm trying to do a "POST" requests, the API tell me to do a "GET" request to have a session cookie, which need to be used in my "POST" request to be "Authenticated".
From the Qlik Sense documentation :
The GET request returns sessions cookies that you include in subsequent requests so that they don't have to be re-authenticated. Depending on the tools you use, you may have to extend the simple connection examples to handle cookies between requests.
When I do a "GET" request, I have the session cookie in response :
But I can't figure out how to use it in my "POST" request.
I tried to take this result, and use the value in a "Cookie" header.
Using the "Cookie" header seems to be not allowed by EasyMorph.
I can't remember where, but I have find somewhere that EasyMorph is storing the cookies to reuse them while doing multiple requests, but I don't know how it works.
I'm looking to use an other authentication process to use "POST" requests to the Qlik Sense QRS API, but I'm struggling a lot.
Although handling of cookies in WebRequest might be tricky at first glance, it could be addressed by using "Reload and run" for the entire workflow rather than executing actions one by one.
Here is the explanation.
To expand on @ckononenko's answer, re-running the whole workflow is one option. Or, at least, make sure to run in one attempt the part of workflow that contains both the "Web request" action that obtains the cookie, and the "Web request" action that uses it. "In one attempt" means the workflow must not stop between these two actions.
Thank you, I saw this post, but it took me a bit of time to understand the point and try a lot of possibilities.
So I had something wrong, and that didn't work.
After a good setup, and doing the "reload and run", I had the following message : "Unable to read data from the transport connection: The connection was closed."
But at least, that was one step.
After trying to figure out what is the problem with my header "Connection : keep-alive", I tried this just like that, to see what happens :
And now, I have an endpoint error but it's because I think I'm wrong on how are working the parameters in the path.
So my initial problem is resolved, thank you for your answer !