- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
How to use JAVA HttpURLConnection or javascript to request resutful-api N.API.getUsers/getUser? How to set Method and Parameters? I always got 404 error!
javascript:
var req = new XMLHttpRequest();
var url = 'http://192.168.0.159:3004/getUsers/';
var body = {room:"xxxxxroomIdxxxxxx"};
var req.onreadystatechange = function(){
if(req.readyState === 4){
console.log(req.responseText);
}
}
req.open('GET', url, false);// POST/GET
req.send(JSON.stringify(body));
Anybody help? Thanks!
- Tags:
- HTML5
- JavaScript*
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page