Unanswered: Normal HTTP POST/GET + access the cookies?
Unanswered: Normal HTTP POST/GET + access the cookies?
Hi,
Is it possible to perform a normal HTTP request (not XHR) in Sensa Touch and to get a normal text/html response?
Using "standardForm: true" on a form sends a normal request, but replaces the current view.
I didn't try to use a normal JavaScript XMLHttpRequest(), but even if that's possible, will I be able to read the cookies received from the server?
Fore more information, I am trying to login to an old website that does not support Ajax requests.
So currently, to make it work with Sensa Touch, I made a proxy on a personal server that logs in to the old server (in a old fashioned way) and returns a Jsonified that Sensa Touch can understand.
As a result, all my requests are done via the "Jsonifier".
So it's returning JSON? That would be simple for Sencha Touch to decode and use. Cookies are sent in the headers which you should also have access to in the response argument.
Well currently it returns JSON because I created a proxy between the website I log in to and Sensa Touch.
So instead of sending the username/password to the website directly, I send it to my proxy through XHR, which creates a normal POST request to the website, gets the HTML, parse it, create a JSON and send the JSON back to Sensa Touch client.
It works fine, but for privacy concerns, I prefer not sending the username/password to the proxy but directly to the website (for logging in).
But the website returns a normal text/html response... and I didn't find a way to handle it in Sensa Touch.
Basically I want to migrate the text/html -> json parsing from the proxy to directly inside the application and get rid of the proxy (which is just some regexp to extract information from the html response and create the JSON object).
Any idea how to do that?
Edit: I noticed the comments introducing the pictures where erroneous and could lead to misinterpretation.
The diagrams represent the CURRENT STATUS (first one) and what I want to achieve (second one).