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
- Realtime for files() works almost well, ...
I have been trying to make use of realtime, today (14.03.26) I have pulled all the latest versions of docker images, and sdk available. Whats working: - Conn...
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Relation Question
How do I create a relation from table y to an others x.$id. in my example I have a users table where I use Appwrites unique User IDs and I want other tables fo...