Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2415efa

Browse files
Merge pull request#107 from appwrite/dev
fix: remove content-type from GET requests
2 parents8ae2126 +0a2355c commit2415efa

File tree

16 files changed

+10
-152
lines changed

16 files changed

+10
-152
lines changed

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#Appwrite Python SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square)
4-
![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.6.2-blue.svg?style=flat-square)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

‎appwrite/client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ def __init__(self):
1414
self._endpoint='https://cloud.appwrite.io/v1'
1515
self._global_headers= {
1616
'content-type':'',
17-
'user-agent' :f'AppwritePythonSDK/9.0.3 ({platform.uname().system};{platform.uname().version};{platform.uname().machine})',
17+
'user-agent' :f'AppwritePythonSDK/10.0.0 ({platform.uname().system};{platform.uname().version};{platform.uname().machine})',
1818
'x-sdk-name':'Python',
1919
'x-sdk-platform':'server',
2020
'x-sdk-language':'python',
21-
'x-sdk-version':'9.0.3',
21+
'x-sdk-version':'10.0.0',
2222
'X-Appwrite-Response-Format' :'1.6.0',
2323
}
2424

@@ -27,6 +27,9 @@ def set_self_signed(self, status=True):
2727
returnself
2828

2929
defset_endpoint(self,endpoint):
30+
ifnotendpoint.startswith('http://')andnotendpoint.startswith('https://'):
31+
raiseAppwriteException('Invalid endpoint URL: '+endpoint)
32+
3033
self._endpoint=endpoint
3134
returnself
3235

‎appwrite/enums/name.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class Name(Enum):
88
V1_FUNCTIONS="v1-functions"
99
V1_STATS_RESOURCES="v1-stats-resources"
1010
V1_STATS_USAGE="v1-stats-usage"
11-
V1_STATS_USAGE_DUMP="v1-stats-usage-dump"
1211
V1_WEBHOOKS="v1-webhooks"
1312
V1_CERTIFICATES="v1-certificates"
1413
V1_BUILDS="v1-builds"

‎appwrite/enums/o_auth_provider.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class OAuthProvider(Enum):
1515
DROPBOX="dropbox"
1616
ETSY="etsy"
1717
FACEBOOK="facebook"
18+
FIGMA="figma"
1819
GITHUB="github"
1920
GITLAB="gitlab"
2021
GOOGLE="google"

‎appwrite/services/account.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ def get(self) -> Dict[str, Any]:
2929
api_params= {}
3030

3131
returnself.client.call('get',api_path, {
32-
'content-type':'application/json',
3332
},api_params)
3433

3534
defcreate(self,user_id:str,email:str,password:str,name:str=None)->Dict[str,Any]:
@@ -145,7 +144,6 @@ def list_identities(self, queries: List[str] = None) -> Dict[str, Any]:
145144
api_params['queries']=queries
146145

147146
returnself.client.call('get',api_path, {
148-
'content-type':'application/json',
149147
},api_params)
150148

151149
defdelete_identity(self,identity_id:str)->Dict[str,Any]:
@@ -228,7 +226,6 @@ def list_logs(self, queries: List[str] = None) -> Dict[str, Any]:
228226
api_params['queries']=queries
229227

230228
returnself.client.call('get',api_path, {
231-
'content-type':'application/json',
232229
},api_params)
233230

234231
defupdate_mfa(self,mfa:bool)->Dict[str,Any]:
@@ -454,7 +451,6 @@ def list_mfa_factors(self) -> Dict[str, Any]:
454451
api_params= {}
455452

456453
returnself.client.call('get',api_path, {
457-
'content-type':'application/json',
458454
},api_params)
459455

460456
defget_mfa_recovery_codes(self)->Dict[str,Any]:
@@ -476,7 +472,6 @@ def get_mfa_recovery_codes(self) -> Dict[str, Any]:
476472
api_params= {}
477473

478474
returnself.client.call('get',api_path, {
479-
'content-type':'application/json',
480475
},api_params)
481476

482477
defcreate_mfa_recovery_codes(self)->Dict[str,Any]:
@@ -647,7 +642,6 @@ def get_prefs(self) -> Dict[str, Any]:
647642
api_params= {}
648643

649644
returnself.client.call('get',api_path, {
650-
'content-type':'application/json',
651645
},api_params)
652646

653647
defupdate_prefs(self,prefs:dict)->Dict[str,Any]:
@@ -785,7 +779,6 @@ def list_sessions(self) -> Dict[str, Any]:
785779
api_params= {}
786780

787781
returnself.client.call('get',api_path, {
788-
'content-type':'application/json',
789782
},api_params)
790783

791784
defdelete_sessions(self)->Dict[str,Any]:
@@ -1015,7 +1008,6 @@ def get_session(self, session_id: str) -> Dict[str, Any]:
10151008

10161009

10171010
returnself.client.call('get',api_path, {
1018-
'content-type':'application/json',
10191011
},api_params)
10201012

10211013
defupdate_session(self,session_id:str)->Dict[str,Any]:
@@ -1205,7 +1197,7 @@ def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, fai
12051197
Parameters
12061198
----------
12071199
provider : OAuthProvider
1208-
OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
1200+
OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook,figma,github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
12091201
success : str
12101202
URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
12111203
failure : str
@@ -1236,7 +1228,6 @@ def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, fai
12361228
api_params['scopes']=scopes
12371229

12381230
returnself.client.call('get',api_path, {
1239-
'content-type':'application/json',
12401231
},api_params,response_type='location')
12411232

12421233
defcreate_phone_token(self,user_id:str,phone:str)->Dict[str,Any]:

‎appwrite/services/avatars.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def get_browser(self, code: Browser, width: float = None, height: float = None,
5050
api_params['quality']=quality
5151

5252
returnself.client.call('get',api_path, {
53-
'content-type':'application/json',
5453
},api_params)
5554

5655
defget_credit_card(self,code:CreditCard,width:float=None,height:float=None,quality:float=None)->bytes:
@@ -94,7 +93,6 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float =
9493
api_params['quality']=quality
9594

9695
returnself.client.call('get',api_path, {
97-
'content-type':'application/json',
9896
},api_params)
9997

10098
defget_favicon(self,url:str)->bytes:
@@ -128,7 +126,6 @@ def get_favicon(self, url: str) -> bytes:
128126
api_params['url']=url
129127

130128
returnself.client.call('get',api_path, {
131-
'content-type':'application/json',
132129
},api_params)
133130

134131
defget_flag(self,code:Flag,width:float=None,height:float=None,quality:float=None)->bytes:
@@ -172,7 +169,6 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit
172169
api_params['quality']=quality
173170

174171
returnself.client.call('get',api_path, {
175-
'content-type':'application/json',
176172
},api_params)
177173

178174
defget_image(self,url:str,width:float=None,height:float=None)->bytes:
@@ -214,7 +210,6 @@ def get_image(self, url: str, width: float = None, height: float = None) -> byte
214210
api_params['height']=height
215211

216212
returnself.client.call('get',api_path, {
217-
'content-type':'application/json',
218213
},api_params)
219214

220215
defget_initials(self,name:str=None,width:float=None,height:float=None,background:str=None)->bytes:
@@ -257,7 +252,6 @@ def get_initials(self, name: str = None, width: float = None, height: float = No
257252
api_params['background']=background
258253

259254
returnself.client.call('get',api_path, {
260-
'content-type':'application/json',
261255
},api_params)
262256

263257
defget_qr(self,text:str,size:float=None,margin:float=None,download:bool=None)->bytes:
@@ -299,5 +293,4 @@ def get_qr(self, text: str, size: float = None, margin: float = None, download:
299293
api_params['download']=download
300294

301295
returnself.client.call('get',api_path, {
302-
'content-type':'application/json',
303296
},api_params)

‎appwrite/services/databases.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]:
3939
api_params['search']=search
4040

4141
returnself.client.call('get',api_path, {
42-
'content-type':'application/json',
4342
},api_params)
4443

4544
defcreate(self,database_id:str,name:str,enabled:bool=None)->Dict[str,Any]:
@@ -113,7 +112,6 @@ def get(self, database_id: str) -> Dict[str, Any]:
113112

114113

115114
returnself.client.call('get',api_path, {
116-
'content-type':'application/json',
117115
},api_params)
118116

119117
defupdate(self,database_id:str,name:str,enabled:bool=None)->Dict[str,Any]:
@@ -224,7 +222,6 @@ def list_collections(self, database_id: str, queries: List[str] = None, search:
224222
api_params['search']=search
225223

226224
returnself.client.call('get',api_path, {
227-
'content-type':'application/json',
228225
},api_params)
229226

230227
defcreate_collection(self,database_id:str,collection_id:str,name:str,permissions:List[str]=None,document_security:bool=None,enabled:bool=None)->Dict[str,Any]:
@@ -315,7 +312,6 @@ def get_collection(self, database_id: str, collection_id: str) -> Dict[str, Any]
315312

316313

317314
returnself.client.call('get',api_path, {
318-
'content-type':'application/json',
319315
},api_params)
320316

321317
defupdate_collection(self,database_id:str,collection_id:str,name:str,permissions:List[str]=None,document_security:bool=None,enabled:bool=None)->Dict[str,Any]:
@@ -447,7 +443,6 @@ def list_attributes(self, database_id: str, collection_id: str, queries: List[st
447443
api_params['queries']=queries
448444

449445
returnself.client.call('get',api_path, {
450-
'content-type':'application/json',
451446
},api_params)
452447

453448
defcreate_boolean_attribute(self,database_id:str,collection_id:str,key:str,required:bool,default:bool=None,array:bool=None)->Dict[str,Any]:
@@ -1625,7 +1620,6 @@ def get_attribute(self, database_id: str, collection_id: str, key: str) -> Dict[
16251620

16261621

16271622
returnself.client.call('get',api_path, {
1628-
'content-type':'application/json',
16291623
},api_params)
16301624

16311625
defdelete_attribute(self,database_id:str,collection_id:str,key:str)->Dict[str,Any]:
@@ -1761,7 +1755,6 @@ def list_documents(self, database_id: str, collection_id: str, queries: List[str
17611755
api_params['queries']=queries
17621756

17631757
returnself.client.call('get',api_path, {
1764-
'content-type':'application/json',
17651758
},api_params)
17661759

17671760
defcreate_document(self,database_id:str,collection_id:str,document_id:str,data:dict,permissions:List[str]=None)->Dict[str,Any]:
@@ -1862,7 +1855,6 @@ def get_document(self, database_id: str, collection_id: str, document_id: str, q
18621855
api_params['queries']=queries
18631856

18641857
returnself.client.call('get',api_path, {
1865-
'content-type':'application/json',
18661858
},api_params)
18671859

18681860
defupdate_document(self,database_id:str,collection_id:str,document_id:str,data:dict=None,permissions:List[str]=None)->Dict[str,Any]:
@@ -1997,7 +1989,6 @@ def list_indexes(self, database_id: str, collection_id: str, queries: List[str]
19971989
api_params['queries']=queries
19981990

19991991
returnself.client.call('get',api_path, {
2000-
'content-type':'application/json',
20011992
},api_params)
20021993

20031994
defcreate_index(self,database_id:str,collection_id:str,key:str,type:IndexType,attributes:List[str],orders:List[str]=None)->Dict[str,Any]:
@@ -2101,7 +2092,6 @@ def get_index(self, database_id: str, collection_id: str, key: str) -> Dict[str,
21012092

21022093

21032094
returnself.client.call('get',api_path, {
2104-
'content-type':'application/json',
21052095
},api_params)
21062096

21072097
defdelete_index(self,database_id:str,collection_id:str,key:str)->Dict[str,Any]:

‎appwrite/services/functions.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def list(self, queries: List[str] = None, search: str = None) -> Dict[str, Any]:
3939
api_params['search']=search
4040

4141
returnself.client.call('get',api_path, {
42-
'content-type':'application/json',
4342
},api_params)
4443

4544
defcreate(self,function_id:str,name:str,runtime:Runtime,execute:List[str]=None,events:List[str]=None,schedule:str=None,timeout:float=None,enabled:bool=None,logging:bool=None,entrypoint:str=None,commands:str=None,scopes:List[str]=None,installation_id:str=None,provider_repository_id:str=None,provider_branch:str=None,provider_silent_mode:bool=None,provider_root_directory:str=None,template_repository:str=None,template_owner:str=None,template_root_directory:str=None,template_version:str=None,specification:str=None)->Dict[str,Any]:
@@ -162,7 +161,6 @@ def list_runtimes(self) -> Dict[str, Any]:
162161
api_params= {}
163162

164163
returnself.client.call('get',api_path, {
165-
'content-type':'application/json',
166164
},api_params)
167165

168166
deflist_specifications(self)->Dict[str,Any]:
@@ -185,7 +183,6 @@ def list_specifications(self) -> Dict[str, Any]:
185183
api_params= {}
186184

187185
returnself.client.call('get',api_path, {
188-
'content-type':'application/json',
189186
},api_params)
190187

191188
defget(self,function_id:str)->Dict[str,Any]:
@@ -217,7 +214,6 @@ def get(self, function_id: str) -> Dict[str, Any]:
217214

218215

219216
returnself.client.call('get',api_path, {
220-
'content-type':'application/json',
221217
},api_params)
222218

223219
defupdate(self,function_id:str,name:str,runtime:Runtime=None,execute:List[str]=None,events:List[str]=None,schedule:str=None,timeout:float=None,enabled:bool=None,logging:bool=None,entrypoint:str=None,commands:str=None,scopes:List[str]=None,installation_id:str=None,provider_repository_id:str=None,provider_branch:str=None,provider_silent_mode:bool=None,provider_root_directory:str=None,specification:str=None)->Dict[str,Any]:
@@ -373,7 +369,6 @@ def list_deployments(self, function_id: str, queries: List[str] = None, search:
373369
api_params['search']=search
374370

375371
returnself.client.call('get',api_path, {
376-
'content-type':'application/json',
377372
},api_params)
378373

379374
defcreate_deployment(self,function_id:str,code:InputFile,activate:bool,entrypoint:str=None,commands:str=None,on_progress=None)->Dict[str,Any]:
@@ -472,7 +467,6 @@ def get_deployment(self, function_id: str, deployment_id: str) -> Dict[str, Any]
472467

473468

474469
returnself.client.call('get',api_path, {
475-
'content-type':'application/json',
476470
},api_params)
477471

478472
defupdate_deployment(self,function_id:str,deployment_id:str)->Dict[str,Any]:
@@ -665,7 +659,6 @@ def get_deployment_download(self, function_id: str, deployment_id: str) -> bytes
665659

666660

667661
returnself.client.call('get',api_path, {
668-
'content-type':'application/json',
669662
},api_params)
670663

671664
deflist_executions(self,function_id:str,queries:List[str]=None,search:str=None)->Dict[str,Any]:
@@ -703,7 +696,6 @@ def list_executions(self, function_id: str, queries: List[str] = None, search: s
703696
api_params['search']=search
704697

705698
returnself.client.call('get',api_path, {
706-
'content-type':'application/json',
707699
},api_params)
708700

709701
defcreate_execution(self,function_id:str,body:str=None,xasync:bool=None,path:str=None,method:ExecutionMethod=None,headers:dict=None,scheduled_at:str=None)->Dict[str,Any]:
@@ -791,7 +783,6 @@ def get_execution(self, function_id: str, execution_id: str) -> Dict[str, Any]:
791783

792784

793785
returnself.client.call('get',api_path, {
794-
'content-type':'application/json',
795786
},api_params)
796787

797788
defdelete_execution(self,function_id:str,execution_id:str)->Dict[str,Any]:
@@ -862,7 +853,6 @@ def list_variables(self, function_id: str) -> Dict[str, Any]:
862853

863854

864855
returnself.client.call('get',api_path, {
865-
'content-type':'application/json',
866856
},api_params)
867857

868858
defcreate_variable(self,function_id:str,key:str,value:str)->Dict[str,Any]:
@@ -944,7 +934,6 @@ def get_variable(self, function_id: str, variable_id: str) -> Dict[str, Any]:
944934

945935

946936
returnself.client.call('get',api_path, {
947-
'content-type':'application/json',
948937
},api_params)
949938

950939
defupdate_variable(self,function_id:str,variable_id:str,key:str,value:str=None)->Dict[str,Any]:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp