-
Notifications
You must be signed in to change notification settings - Fork 0
AJAX Front End
Leah Copeland edited this page Mar 5, 2021
·
20 revisions
/service/author/{AUTHOR_ID}/nonfollowers/ to retrieve a json response containing users that the logged in user may follow/send a friend request to
- Request method: GET
function fetchJSON(url) {
var request = new Request(url);
return fetch(request).then((response) => {
if (response.status === 200 || response.status == 404) {
return response.json(); // return a Promise
} else {
alert("Something went wrong: " + response.status);
}
});
}
/service/author/{AUTHOR_ID}/followers/ to retrieve a json response containing users that are following the logged in user (sending a friend request to the logged in user)
- Request method: GET
function fetchJSON(url) {
var request = new Request(url);
return fetch(request).then((response) => {
if (response.status === 200 || response.status == 404) {
return response.json(); // return a Promise
} else {
alert("Something went wrong: " + response.status);
}
});
}
/service/author/{AUTHOR_ID}/friends/ to retrieve a json response containing users that are friends with the logged in user (both users are following each other)
- Request method: GET
function fetchJSON(url) {
var request = new Request(url);
return fetch(request).then((response) => {
if (response.status === 200 || response.status == 404) {
return response.json(); // return a Promise
} else {
alert("Something went wrong: " + response.status);
}
});
}
/service/author/{AUTHOR_ID}/friends/ to retrieve a list of users that are following the logged in user (that are friend requesting them)
- Request method: GET
function fetchJSON(url) {
var request = new Request(url);
return fetch(request).then((response) => {
if (response.status === 200 || response.status == 404) {
return response.json(); // return a Promise
} else {
alert("Something went wrong: " + response.status);
}
});
}
Citrus Network: Join the citrusy movement and take control of your own data!
Copyright (C) 2021 Alex Bali, Joe Ha, Kyle Fujishige, Leah Copeland, Nhan Nguyen