Skip to content

fix: remove content-type from GET requests #76

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 4 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Add this to your package's `pubspec.yaml` file:

```yml
dependencies:
dart_appwrite: ^14.0.0
dart_appwrite: ^15.0.0
```

You can install packages from the command line:
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/update-float-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ AttributeFloat result = await databases.updateFloatAttribute(
collectionId: '<COLLECTION_ID>',
key: '',
xrequired: false,
min: 0,
max: 0,
xdefault: 0,
min: 0, // (optional)
max: 0, // (optional)
newKey: '', // (optional)
);
4 changes: 2 additions & 2 deletions docs/examples/databases/update-integer-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ AttributeInteger result = await databases.updateIntegerAttribute(
collectionId: '<COLLECTION_ID>',
key: '',
xrequired: false,
min: 0,
max: 0,
xdefault: 0,
min: 0, // (optional)
max: 0, // (optional)
newKey: '', // (optional)
);
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Client client = Client()

Health health = Health(client);

HealthQueue result = await health.getQueueUsageDump(
HealthQueue result = await health.getQueueStatsResources(
threshold: 0, // (optional)
);
10 changes: 0 additions & 10 deletions docs/examples/health/get-queue.md

This file was deleted.

16 changes: 8 additions & 8 deletions lib/services/account.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Account extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -93,7 +93,7 @@ class Account extends Service {

final Map<String, dynamic> apiParams = {'queries': queries};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -155,7 +155,7 @@ class Account extends Service {

final Map<String, dynamic> apiParams = {'queries': queries};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -314,7 +314,7 @@ class Account extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand All @@ -335,7 +335,7 @@ class Account extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -468,7 +468,7 @@ class Account extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -570,7 +570,7 @@ class Account extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -733,7 +733,7 @@ class Account extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down
29 changes: 15 additions & 14 deletions lib/services/databases.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Databases extends Service {
'search': search,
};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -67,7 +67,7 @@ class Databases extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -143,7 +143,7 @@ class Databases extends Service {
'search': search,
};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -204,7 +204,7 @@ class Databases extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -285,7 +285,7 @@ class Databases extends Service {

final Map<String, dynamic> apiParams = {'queries': queries};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -622,9 +622,9 @@ class Databases extends Service {
required String collectionId,
required String key,
required bool xrequired,
required double min,
required double max,
required double? xdefault,
double? min,
double? max,
String? newKey,
}) async {
final String apiPath =
Expand Down Expand Up @@ -700,9 +700,9 @@ class Databases extends Service {
required String collectionId,
required String key,
required bool xrequired,
required int min,
required int max,
required int? xdefault,
int? min,
int? max,
String? newKey,
}) async {
final String apiPath =
Expand Down Expand Up @@ -997,7 +997,7 @@ class Databases extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -1082,7 +1082,7 @@ class Databases extends Service {

final Map<String, dynamic> apiParams = {'queries': queries};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand All @@ -1098,6 +1098,7 @@ class Databases extends Service {
/// collection resource using either a [server
/// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
/// API or directly from your database console.
///
Future<models.Document> createDocument({
required String databaseId,
required String collectionId,
Expand Down Expand Up @@ -1144,7 +1145,7 @@ class Databases extends Service {

final Map<String, dynamic> apiParams = {'queries': queries};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -1227,7 +1228,7 @@ class Databases extends Service {

final Map<String, dynamic> apiParams = {'queries': queries};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -1288,7 +1289,7 @@ class Databases extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down
20 changes: 10 additions & 10 deletions lib/services/functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Functions extends Service {
'search': search,
};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -103,7 +103,7 @@ class Functions extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand All @@ -122,7 +122,7 @@ class Functions extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand All @@ -143,7 +143,7 @@ class Functions extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -251,7 +251,7 @@ class Functions extends Service {
'search': search,
};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -322,7 +322,7 @@ class Functions extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -481,7 +481,7 @@ class Functions extends Service {
'search': search,
};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -543,7 +543,7 @@ class Functions extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -590,7 +590,7 @@ class Functions extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down Expand Up @@ -639,7 +639,7 @@ class Functions extends Service {

final Map<String, dynamic> apiParams = {};

final Map<String, String> apiHeaders = {'content-type': 'application/json'};
final Map<String, String> apiHeaders = {};

final res = await client.call(
HttpMethod.get,
Expand Down
Loading