public static bool site_Online(this API_Firebase firebase) { if (firebase.site_Configured()) { var randomAreaUri = firebase.site_Uri(10.randomLetters()); // sets a random area randomAreaUri.str().info(); var result = randomAreaUri.GET(); // makes a GET request to it return(result == "null"); // if the URL exists and the AuthToken is valid, we will get a null value as response } return(false); }
public static string HTTP_Request(this API_Firebase firebase, string method, object data) { var targetUrl = firebase.site_Uri().str(); var jsonData = data.notNull() ? data.json() : ""; var web = new Web(); web.Headers_Request.Add("X-HTTP-Method-Override", method); return(web.getUrlContents_POST(targetUrl, jsonData)); }
public static Uri site_Uri(this API_Firebase firebase) { return(firebase.site_Uri(firebase.Area)); }
public static string GET(this API_Firebase firebase) { return(firebase.site_Uri().GET()); }