mirror of
https://github.com/appwrite/sdk-for-flutter.git
synced 2026-04-07 19:27:41 +00:00
Merge pull request #245 from appwrite/dev
fix: remove content-type from GET requests
This commit is contained in:
@@ -21,7 +21,7 @@ Add this to your package's `pubspec.yaml` file:
|
||||
|
||||
```yml
|
||||
dependencies:
|
||||
appwrite: ^15.0.0
|
||||
appwrite: ^15.0.1
|
||||
```
|
||||
|
||||
You can install packages from the command line:
|
||||
|
||||
@@ -11,7 +11,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,
|
||||
@@ -94,7 +94,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,
|
||||
@@ -156,7 +156,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,
|
||||
@@ -315,7 +315,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,
|
||||
@@ -336,7 +336,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,
|
||||
@@ -469,7 +469,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,
|
||||
@@ -571,7 +571,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,
|
||||
@@ -795,7 +795,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,
|
||||
|
||||
@@ -20,7 +20,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,
|
||||
@@ -36,6 +36,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,
|
||||
@@ -82,7 +83,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,
|
||||
|
||||
@@ -23,7 +23,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,
|
||||
@@ -85,7 +85,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,
|
||||
|
||||
@@ -17,7 +17,7 @@ class Locale 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,
|
||||
@@ -36,7 +36,7 @@ class Locale 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,
|
||||
@@ -55,7 +55,7 @@ class Locale 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,
|
||||
@@ -74,7 +74,7 @@ class Locale 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,
|
||||
@@ -93,7 +93,7 @@ class Locale 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,
|
||||
@@ -112,7 +112,7 @@ class Locale 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,
|
||||
@@ -132,7 +132,7 @@ class Locale 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,
|
||||
@@ -151,7 +151,7 @@ class Locale 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,
|
||||
|
||||
@@ -22,7 +22,7 @@ class Storage 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,
|
||||
@@ -101,7 +101,7 @@ class Storage 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,
|
||||
|
||||
@@ -16,7 +16,7 @@ class Teams 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,
|
||||
@@ -62,7 +62,7 @@ class Teams 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,
|
||||
@@ -132,7 +132,7 @@ class Teams 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,
|
||||
@@ -213,7 +213,7 @@ class Teams 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,
|
||||
@@ -319,7 +319,7 @@ class Teams 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,
|
||||
|
||||
@@ -40,7 +40,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
|
||||
'x-sdk-name': 'Flutter',
|
||||
'x-sdk-platform': 'client',
|
||||
'x-sdk-language': 'flutter',
|
||||
'x-sdk-version': '15.0.0',
|
||||
'x-sdk-version': '15.0.1',
|
||||
'X-Appwrite-Response-Format': '1.6.0',
|
||||
};
|
||||
|
||||
@@ -94,15 +94,24 @@ class ClientBrowser extends ClientBase with ClientMixin {
|
||||
|
||||
@override
|
||||
ClientBrowser setEndpoint(String endPoint) {
|
||||
if (!endPoint.startsWith('http://') && !endPoint.startsWith('https://')) {
|
||||
throw AppwriteException('Invalid endpoint URL: $endPoint');
|
||||
}
|
||||
|
||||
_endPoint = endPoint;
|
||||
_endPointRealtime = endPoint
|
||||
.replaceFirst('https://', 'wss://')
|
||||
.replaceFirst('http://', 'ws://');
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
ClientBrowser setEndPointRealtime(String endPoint) {
|
||||
if (!endPoint.startsWith('ws://') && !endPoint.startsWith('wss://')) {
|
||||
throw AppwriteException('Invalid realtime endpoint URL: $endPoint');
|
||||
}
|
||||
|
||||
_endPointRealtime = endPoint;
|
||||
return this;
|
||||
}
|
||||
|
||||
+10
-1
@@ -59,7 +59,7 @@ class ClientIO extends ClientBase with ClientMixin {
|
||||
'x-sdk-name': 'Flutter',
|
||||
'x-sdk-platform': 'client',
|
||||
'x-sdk-language': 'flutter',
|
||||
'x-sdk-version': '15.0.0',
|
||||
'x-sdk-version': '15.0.1',
|
||||
'X-Appwrite-Response-Format': '1.6.0',
|
||||
};
|
||||
|
||||
@@ -124,15 +124,24 @@ class ClientIO extends ClientBase with ClientMixin {
|
||||
|
||||
@override
|
||||
ClientIO setEndpoint(String endPoint) {
|
||||
if (!endPoint.startsWith('http://') && !endPoint.startsWith('https://')) {
|
||||
throw AppwriteException('Invalid endpoint URL: $endPoint');
|
||||
}
|
||||
|
||||
_endPoint = endPoint;
|
||||
_endPointRealtime = endPoint
|
||||
.replaceFirst('https://', 'wss://')
|
||||
.replaceFirst('http://', 'ws://');
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
ClientIO setEndPointRealtime(String endPoint) {
|
||||
if (!endPoint.startsWith('ws://') && !endPoint.startsWith('wss://')) {
|
||||
throw AppwriteException('Invalid realtime endpoint URL: $endPoint');
|
||||
}
|
||||
|
||||
_endPointRealtime = endPoint;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,8 @@ enum CreditCard {
|
||||
unionChinaPay(value: 'union-china-pay'),
|
||||
visa(value: 'visa'),
|
||||
mIR(value: 'mir'),
|
||||
maestro(value: 'maestro');
|
||||
maestro(value: 'maestro'),
|
||||
rupay(value: 'rupay');
|
||||
|
||||
const CreditCard({required this.value});
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ enum OAuthProvider {
|
||||
dropbox(value: 'dropbox'),
|
||||
etsy(value: 'etsy'),
|
||||
facebook(value: 'facebook'),
|
||||
figma(value: 'figma'),
|
||||
github(value: 'github'),
|
||||
gitlab(value: 'gitlab'),
|
||||
google(value: 'google'),
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
name: appwrite
|
||||
version: 15.0.0
|
||||
version: 15.0.1
|
||||
description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API
|
||||
homepage: https://appwrite.io
|
||||
repository: https://github.com/appwrite/sdk-for-flutter
|
||||
|
||||
Reference in New Issue
Block a user