Hi,
I am working on a Minecraft mod that will gather data from an appwrite database. I got it working but i want to add Queries if possible.
This is my current code:
TypeScript
private void fetchPlayerRank(String playerName) {
String url = APPWRITE_ENDPOINT + "/databases/" + DATABASE_ID + "/collections/" + COLLECTION_ID + "/documents";
LOGGER.info("Fetching rank data for " + playerName + " from " + url);
try {
// Create the URL object
URL urlObj = new URL(url);
HttpURLConnection connection = (HttpURLConnection) urlObj.openConnection();
// Set the request method and headers
connection.setRequestMethod("GET");
connection.setRequestProperty("X-Appwrite-Project", PROJECT_ID);
connection.setRequestProperty("X-Appwrite-Key", API_KEY);
// Get the response code
int statusCode = connection.getResponseCode();
if (statusCode >= 200 && statusCode < 300) {
// Success - process the response
try (BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
LOGGER.info("Rank data for " + playerName + ": " + response.toString());
}
} else {
// Log unexpected status codes
LOGGER.error("Unexpected response code: " + statusCode);
}
} catch (IOException e) {
LOGGER.error("Failed to fetch rank data: ", e);
}}
TL;DR
Developers wants to add queries to their HTTPRequest code for a Minecraft mod interacting with an appwrite database. They included their current code for fetching player rank data.Recommended threads
- Appwrite console is too heavy
The Appwrite console is too heavy And all of my services broken Any support , please
- Usage of the new Client() and dealing wi...
Hey guys, just a quick one - we had some web traffic the other day and it ended up bombing out - To put in perspective of how the app works, we have a Nuxt Ap...
- Increase by operators
I see appwrite have bunch of useful operators for querieng db. One more I would like to suggest is operators like increase the count of a int columns by 1,2.. ...