Languages

Menu
Sites
Language
Send DATA to server

i want to send data to server (post ) in body how i can send my data to server ?

Responses

14 Replies
AVSukhov

Hello,

Tizen support XMLHttpRequest. For more info please refer:

https://developer.tizen.org/documentation/guides/web-application/w3chtml5supplementary-features/communication/xmlhttprequest-level-1-and-2

appdaily

i am getting client.readyState =1

AVSukhov

Hello,

Could you please provide your code sample?

appdaily
var client = new XMLHttpRequest(); client .open( "post", "http://10.20.20.30/api/myapi"); client.setRequestHeader("Content-Type", "application/octet-stream"); client.onreadystatechange = function() { if (client.readyState == 4 && client.status == 200) { alert(client.status); } } client.send("sad");
AVSukhov

Hello,

Try to put client.onreadystatechange() before client.open()

appdaily

no luck

AVSukhov

Try to use Content-Type text/plain instead octet-stream

appdaily
no luck onabort: null onerror: null onload: null onloadend: null onloadstart: null onprogress: null onreadystatechange: function () { ontimeout: null readyState: 1 response: "" responseText: "" responseType: "" responseXML: null status: [Exception: DOMException] statusText: [Exception: DOMException] timeout: 0 upload: XMLHttpRequestUpload withCredentials: false __proto__: XMLHttpRequestPrototype
Alex Dem

Hi,
Also just fyi, if you have created Tizen UI Framework or JQueryMobile Web project - jquery is added automatically into project : hence you could use a full suite of Ajax capabilities:
https://api.jquery.com/category/ajax/
see jQuery.get(), jQuery.post() etc
Alexey.

appdaily

i have cr8 tizen web application

appdaily

but if i am debugging when i go to networl it showing method get  status  canceld

AVSukhov

Hello,

Dou you add your URL to access tag in config.xml?

F.e. <access origin="*" subdomains="true" />

appdaily

in policy its already mention

AVSukhov

Hello,

You may have problem with Cross-Origin Resource Sharing

For more info please refer:

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.tutorials/html/web/w3c/security/cors_tutorial_w.htm