Tizen Gear 2 Web请求

I would like to make a web request from tizen gear 2 with javascript. My code is:

    var url = "https://..."
    var client = new XMLHttpRequest();

    client.open("POST", url, true);
    client.setRequestHeader("Accept-Language", 'en-us');
    client.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    client.setRequestHeader("Connection", "close");
    client.send('data=2000');
    client.onreadystatechange = function() { alert(client.responseText); };

When I run the application on gear(connected through bluetooth at mobile), no web request is send to my website. I have already set in my config.xml <access origin="*" subdomains="true"></access> Can you please help me with this problem?

Gear 2 cannot directly send web requests.

The only workaround I know of is development of a custom Samsung Accessory service (using Accessory SDK) that will send requests on behalf of Gear. Then you will need to integrate it with your Gear app.

Cannot share any code though, and AFAIK there's not such sample in Accessory SDK ;(

BTW: Gear S have 3G and WiFi interfaces, so this code should work if any of those is available (permissions/privileges apply though, including the "access origin" one you mention in your question).

Gear 2 doesn't have sim functionality or WIFI so the only way is to make a companion app and request the host app to hit that API and then get response and send it to gear.