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
- MongoDb Database Breaks integer[] & bigi...
I've got a table with the below column created. When I try to insert the value `[-3408048000]` into it, the dart sdk cloud function call is successful (no error...
- 1.9.6 Console handles all array columns ...
When creating or updating a row in the appwrite 1.9.6 web console, the form treats all list columns as a type string. Even if the column is a list of booleans, ...
- Temporary $permissions hickup?
Hello, today at ~13:50 (CEST/UTC+2) our customers reported they couldn't see any data in our application. We checked and indeed, the application was working, bu...