Results 1 to 3 of 3

Thread: Normal HTTP POST/GET + access the cookies?

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Vote Rating

    Question 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.
    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".



    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

  2. #2
    Sencha User mitchellsimoens's Avatar
    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 @LikelyMitch
    Modus Create, Senior Frontend Engineer
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Vote Rating


    Hi Mitchell,

    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).

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts