Results 1 to 9 of 9

Thread: How to send https requst

  1. #1

    Default How to send https requst

    I have a problem how to send https request with Basic authorization. Debugging the app in the localhost and send request to somedomain.com/api. But it always go to failure function and return the response.status with 0. Do I miss some setting?

    Code:
            var auth = "Basic "+Base64.encode(username + ":" + password);
            console.log(">> auth:"+auth);
            Ext.Ajax.request({
                url: 'https://www.somedomain.com/api/'+username,
                withCredentials: true,
                method: 'GET',
                cors: true,
    
    
                headers: {
                    "Authorization": auth
                },
                success: function (response) {
                },
                failure: function (response) {
                }
            });

  2. #2
    Sencha Premium User
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    736
    Answers
    42

    Default

    I think the problem might be that you have to use POST for basic authentication.

  3. #3

    Default

    if I change the method to post , the same result returned.

  4. #4
    Sencha Premium User
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    736
    Answers
    42

    Default

    and the same with http works?

  5. #5

    Default

    I mean that changing the method to post from get with https, the result are same return 0.

  6. #6
    Sencha Premium User
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    736
    Answers
    42

    Default

    I was just asking if basic authentication via http (not https) is working for you?
    Because I use it too this way, but only over http for the moment...

    BTW: I found this thread here: http://www.sencha.com/forum/showthread.php?251132

  7. #7

    Default

    Quote Originally Posted by ingo.hefti View Post
    I was just asking if basic authentication via http (not https) is working for you?
    Because I use it too this way, but only over http for the moment...

    BTW: I found this thread here: http://www.sencha.com/forum/showthread.php?251132
    I have setup a simple server with http, and sent request to this server. I can get the correct response from server.

    maybe the problem is related with root CA. But do you know how to install with sencha?

  8. #8
    Sencha User
    Join Date
    Dec 2012
    Posts
    32
    Answers
    2

    Default

    do you tested this url in browser? tell more about your server api, generally you need allow headers with "Authorization" in the your server...

  9. #9
    Sencha User
    Join Date
    Apr 2012
    Posts
    164
    Answers
    13

    Default

    Sounds like your problem isn't Sencha but with how you've setup you're server.
    If you can't make the call to the https through a browser and get a good response, then the issue is definitely your server.

    Quote Originally Posted by pyanfield View Post
    I have setup a simple server with http, and sent request to this server. I can get the correct response from server.

    maybe the problem is related with root CA. But do you know how to install with sencha?

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
  •