Xmlhttprequest returns 401 on phonegap/android application

后端 未结 1 748
失恋的感觉
失恋的感觉 2021-01-25 20:06

I want to access to the service web via my PhoneGap/android application with xmlhttprequest, but the code below returns \"Status is 401\".

 var request = new XML         


        
相关标签:
1条回答
  • 2021-01-25 20:45

    if your website is created by prestashop, so to access the webservice using Xmlhttprequest, the request.open should be like this:

    request.open("GET","http://www.mysite.fr/api/customes/2?PHP_AUTH_USER="+PHP_AUTH_USER+"&ws_key="+ws_key,true);
    

    with: PHP_AUTH_USER="" and ws_ke=key_generated_by_the_webservice

    0 讨论(0)
提交回复
热议问题