Languages

Menu
Sites
Language
POST requests are being converted to GET requests

I am trying to create an application that interfaces with a device that requires messages to be sent as POST with empty bodies. Before starting on it with Tizen I tried the following from within a web browser and it worked fine. 

this.xhttp = new XMLHttpRequest();
this.xhttp.open("POST", url);
this.xhttp.send('');

When I tried using the same code in a Tizen Web application it fails. The debug console shows that an HTTP GET request is failing. But I sent my requests as a post. Tizen appears to be changing it somewhere.  Looking in the "Network" panel of the Chrome development tools 


I also tried using JQuery to make the request to the same effect. 

$.ajax({
 
type: "POST",
 
url: url,
 
data: null
});

Can someone tell my why these requests are getting logged as failed GET requests? 

Responses

3 Replies
Armaan-Ul- Islam

Tizen Developer Site Offers some examples, sample codes and guides for using XMLHttpRequest in Tizen. Please check these links out:

XMLHttpRequest Guide

Example Code for XMLHttpRequest

Tip & Tech document with Sample Application using XMLHttpRequest

 

In addition please make sure you have added 'Internet' privilege and 'remote resource' access policy in config.xml file. A Relevant post:

https://stackoverflow.com/questions/37783743/not-able-to-connect-to-internet-via-proxy-in-tizen-emulator/37960903#37960903

 

Joel Ivory Johnson

Thanks, the code was right, but the key thing that I was missing was to add the domain ('*') to the network policy. 

Armaan-Ul- Islam

You're Welcome.