Skip to content

fix: remove content-type from GET requests #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-kotlin.svg?color=green&style=flat-square)
![License](https://img.shields.io/github/license/appwrite/sdk-for-kotlin.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.6.2-blue.svg?style=flat-square)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

Expand Down Expand Up @@ -39,7 +39,7 @@ repositories {
Next, add the dependency to your project's `build.gradle(.kts)` file:

```groovy
implementation("io.appwrite:sdk-for-kotlin:7.0.0")
implementation("io.appwrite:sdk-for-kotlin:8.0.0")
```

### Maven
Expand All @@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file:
<dependency>
<groupId>io.appwrite</groupId>
<artifactId>sdk-for-kotlin</artifactId>
<version>7.0.0</version>
<version>8.0.0</version>
</dependency>
</dependencies>
```
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/java/databases/update-float-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ databases.updateFloatAttribute(
"<COLLECTION_ID>", // collectionId
"", // key
false, // required
0, // min
0, // max
0, // default
0, // min (optional)
0, // max (optional)
"", // newKey (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/java/databases/update-integer-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ databases.updateIntegerAttribute(
"<COLLECTION_ID>", // collectionId
"", // key
false, // required
0, // min
0, // max
0, // default
0, // min (optional)
0, // max (optional)
"", // newKey (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Client client = new Client()

Health health = new Health(client);

health.getQueueUsageDump(
health.getQueueStatsResources(
0, // threshold (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
19 changes: 0 additions & 19 deletions docs/examples/java/health/get-queue.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/examples/kotlin/databases/update-float-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ val response = databases.updateFloatAttribute(
collectionId = "<COLLECTION_ID>",
key = "",
required = false,
min = 0,
max = 0,
default = 0,
min = 0, // optional
max = 0, // optional
newKey = "" // optional
)
4 changes: 2 additions & 2 deletions docs/examples/kotlin/databases/update-integer-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ val response = databases.updateIntegerAttribute(
collectionId = "<COLLECTION_ID>",
key = "",
required = false,
min = 0,
max = 0,
default = 0,
min = 0, // optional
max = 0, // optional
newKey = "" // optional
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ val client = Client()

val health = Health(client)

val response = health.getQueueUsageDump(
val response = health.getQueueStatsResources(
threshold = 0 // optional
)
12 changes: 0 additions & 12 deletions docs/examples/kotlin/health/get-queue.md

This file was deleted.

14 changes: 10 additions & 4 deletions src/main/kotlin/io/appwrite/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import java.io.BufferedReader
import java.io.File
import java.io.RandomAccessFile
import java.io.IOException
import java.lang.IllegalArgumentException
import java.security.SecureRandom
import java.security.cert.X509Certificate
import javax.net.ssl.HostnameVerifier
Expand Down Expand Up @@ -57,11 +58,11 @@ class Client @JvmOverloads constructor(
init {
headers = mutableMapOf(
"content-type" to "application/json",
"user-agent" to "AppwriteKotlinSDK/7.0.0 ${System.getProperty("http.agent")}",
"user-agent" to "AppwriteKotlinSDK/8.0.0 ${System.getProperty("http.agent")}",
"x-sdk-name" to "Kotlin",
"x-sdk-platform" to "server",
"x-sdk-language" to "kotlin",
"x-sdk-version" to "7.0.0",
"x-sdk-version" to "8.0.0",
"x-appwrite-response-format" to "1.6.0",
)

Expand Down Expand Up @@ -217,7 +218,12 @@ class Client @JvmOverloads constructor(
*
* @return this
*/
@Throws(IllegalArgumentException::class)
fun setEndpoint(endPoint: String): Client {
require(endPoint.startsWith("http://") || endPoint.startsWith("https://")) {
"Invalid endpoint URL: $endPoint"
}

this.endPoint = endPoint
return this
}
Expand Down Expand Up @@ -551,7 +557,7 @@ class Client @JvmOverloads constructor(
body
)
} else {
AppwriteException(body, response.code)
AppwriteException(body, response.code, "", body)
}
it.cancel(error)
return
Expand Down Expand Up @@ -602,7 +608,7 @@ class Client @JvmOverloads constructor(
body
)
} else {
AppwriteException(body, response.code)
AppwriteException(body, response.code, "", body)
}
it.cancel(error)
return
Expand Down
4 changes: 3 additions & 1 deletion src/main/kotlin/io/appwrite/enums/CreditCard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ enum class CreditCard(val value: String) {
@SerializedName("mir")
MIR("mir"),
@SerializedName("maestro")
MAESTRO("maestro");
MAESTRO("maestro"),
@SerializedName("rupay")
RUPAY("rupay");

override fun toString() = value
}
8 changes: 4 additions & 4 deletions src/main/kotlin/io/appwrite/enums/Name.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ enum class Name(val value: String) {
V1_MAILS("v1-mails"),
@SerializedName("v1-functions")
V1_FUNCTIONS("v1-functions"),
@SerializedName("v1-usage")
V1_USAGE("v1-usage"),
@SerializedName("v1-usage-dump")
V1_USAGE_DUMP("v1-usage-dump"),
@SerializedName("v1-stats-resources")
V1_STATS_RESOURCES("v1-stats-resources"),
@SerializedName("v1-stats-usage")
V1_STATS_USAGE("v1-stats-usage"),
@SerializedName("v1-webhooks")
V1_WEBHOOKS("v1-webhooks"),
@SerializedName("v1-certificates")
Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/io/appwrite/enums/OAuthProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ enum class OAuthProvider(val value: String) {
ETSY("etsy"),
@SerializedName("facebook")
FACEBOOK("facebook"),
@SerializedName("figma")
FIGMA("figma"),
@SerializedName("github")
GITHUB("github"),
@SerializedName("gitlab")
Expand Down
Loading