22 Mar 2012 2:32 AM #1
Unanswered: Normal HTTP POST/GET + access the cookies?
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.
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".
I would like to get rid of the proxy and achieve:
Is there any way to do that in Sensa Touch?
I actually managed to do it with Titanium Mobile but would really like to use Sensa Touch so looking forward to reading a solution!
Last edited by $p00ky; 22 Mar 2012 at 5:29 AM. Reason: formatting new lines
22 Mar 2012 5:14 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
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.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
22 Mar 2012 5:27 AM #3
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).