1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    48
    Vote Rating
    0
    $p00ky is on a distinguished road

      0  

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

    Currently:

    currently.jpg


    I would like to get rid of the proxy and achieve:

    goal.jpg


    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!

    Cheers,

    $p00ky
    Last edited by $p00ky; 22 Mar 2012 at 5:29 AM. Reason: formatting new lines

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,672
    Answers
    3354
    Vote Rating
    747
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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 Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    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 services@sencha.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.

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    48
    Vote Rating
    0
    $p00ky is on a distinguished road

      0  

    Question


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

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar