3) Incorporate your web server in OM2M platform as an OSGi plugin
and attach it to the Jetty Server.
The current OM2M resource tree web interface relies on this
solution.
4) JSONP serialization enable to bypass cross domain issue
however not supported by OM2M.
Hope this clarify the situation for you.
Regards,
Hello everyone,
My team and
I are students at INSA Toulouse, working on a project using
OM2M.
I am trying
to send a simple HTTP GET request from an html file (as a user
interface).
Here is the
code snippet exported from postman that is supposed to send
the request :
...
(awesome) html content before ;) ...
<script
type="text/_javascript_">
function sendRequest() {
$("#req_res").html("--");
var data = "">
var xhr = new
XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange",
function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.setRequestHeader("x-m2m-origin",
"admin:admin");
xhr.setRequestHeader("accept",
"application/xml");
xhr.setRequestHeader("cache-control",
"no-cache");
xhr.setRequestHeader("postman-token",
"3ae1710c-2bb0-2085-9e5e-204486399d93");
xhr.send(data);
}
</script>
... html
...
On postman,
this request seems to work perfectly, but when I try to send
it with XMLHttpRequest(), I get the following error in the web
console :
XMLHttpRequest cannot load http://127.0.0.1:8080/~/in-cse.
Response to preflight request doesn't pass access control
check: No 'Access-Control-Allow-Origin' header is present on
the requested resource. Origin 'null' is therefore not
allowed access. The response had HTTP status code 400.
I tried also
with AJAX but could not find any solution either.
I am
searching for a long time on the web trying to get rid of this
but I could not find any help. I tried so many different
things that I am a bit lost right now.
Does anyone
know how to deal with this kind of issue?
Thank you in
advance from the whole team!
Paul Guirbal
_______________________________________________
om2m-dev mailing list
om2m-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/om2m-dev