@@ -188,7 +188,7 @@ <h1 class="title">Module <code>supertokens_python.querier</code></h1>
188
188
189
189
async def send_get_request(
190
190
self, path: NormalisedURLPath, params: Union[Dict[str, Any], None] = None
191
- ):
191
+ ) -> Dict[str, Any] :
192
192
if params is None:
193
193
params = {}
194
194
@@ -208,7 +208,7 @@ <h1 class="title">Module <code>supertokens_python.querier</code></h1>
208
208
path: NormalisedURLPath,
209
209
data: Union[Dict[str, Any], None] = None,
210
210
test: bool = False,
211
- ):
211
+ ) -> Dict[str, Any] :
212
212
if data is None:
213
213
data = {}
214
214
@@ -235,7 +235,7 @@ <h1 class="title">Module <code>supertokens_python.querier</code></h1>
235
235
236
236
async def send_delete_request(
237
237
self, path: NormalisedURLPath, params: Union[Dict[str, Any], None] = None
238
- ):
238
+ ) -> Dict[str, Any] :
239
239
if params is None:
240
240
params = {}
241
241
@@ -252,7 +252,7 @@ <h1 class="title">Module <code>supertokens_python.querier</code></h1>
252
252
253
253
async def send_put_request(
254
254
self, path: NormalisedURLPath, data: Union[Dict[str, Any], None] = None
255
- ):
255
+ ) -> Dict[str, Any] :
256
256
if data is None:
257
257
data = {}
258
258
@@ -290,7 +290,7 @@ <h1 class="title">Module <code>supertokens_python.querier</code></h1>
290
290
http_function: Callable[[str, str], Awaitable[Response]],
291
291
no_of_tries: int,
292
292
retry_info_map: Optional[Dict[str, int]] = None,
293
- ) -> Any:
293
+ ) -> Dict[str, Any] :
294
294
if no_of_tries == 0:
295
295
raise_general_exception("No SuperTokens core available to query")
296
296
@@ -349,10 +349,14 @@ <h1 class="title">Module <code>supertokens_python.querier</code></h1>
349
349
+ response.text # type: ignore
350
350
)
351
351
352
+ res: Dict[str, Any] = {"_headers": dict(response.headers)}
353
+
352
354
try:
353
- return response.json()
355
+ res.update( response.json() )
354
356
except JSONDecodeError:
355
- return response.text
357
+ res["_text"] = response.text
358
+
359
+ return res
356
360
357
361
except (ConnectionError, NetworkError, ConnectTimeout) as _:
358
362
return await self.__send_request_helper(
@@ -498,7 +502,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
498
502
499
503
async def send_get_request(
500
504
self, path: NormalisedURLPath, params: Union[Dict[str, Any], None] = None
501
- ):
505
+ ) -> Dict[str, Any] :
502
506
if params is None:
503
507
params = {}
504
508
@@ -518,7 +522,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
518
522
path: NormalisedURLPath,
519
523
data: Union[Dict[str, Any], None] = None,
520
524
test: bool = False,
521
- ):
525
+ ) -> Dict[str, Any] :
522
526
if data is None:
523
527
data = {}
524
528
@@ -545,7 +549,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
545
549
546
550
async def send_delete_request(
547
551
self, path: NormalisedURLPath, params: Union[Dict[str, Any], None] = None
548
- ):
552
+ ) -> Dict[str, Any] :
549
553
if params is None:
550
554
params = {}
551
555
@@ -562,7 +566,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
562
566
563
567
async def send_put_request(
564
568
self, path: NormalisedURLPath, data: Union[Dict[str, Any], None] = None
565
- ):
569
+ ) -> Dict[str, Any] :
566
570
if data is None:
567
571
data = {}
568
572
@@ -600,7 +604,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
600
604
http_function: Callable[[str, str], Awaitable[Response]],
601
605
no_of_tries: int,
602
606
retry_info_map: Optional[Dict[str, int]] = None,
603
- ) -> Any:
607
+ ) -> Dict[str, Any] :
604
608
if no_of_tries == 0:
605
609
raise_general_exception("No SuperTokens core available to query")
606
610
@@ -659,10 +663,14 @@ <h2 class="section-title" id="header-classes">Classes</h2>
659
663
+ response.text # type: ignore
660
664
)
661
665
666
+ res: Dict[str, Any] = {"_headers": dict(response.headers)}
667
+
662
668
try:
663
- return response.json()
669
+ res.update( response.json() )
664
670
except JSONDecodeError:
665
- return response.text
671
+ res["_text"] = response.text
672
+
673
+ return res
666
674
667
675
except (ConnectionError, NetworkError, ConnectTimeout) as _:
668
676
return await self.__send_request_helper(
@@ -866,7 +874,7 @@ <h3>Methods</h3>
866
874
</ details >
867
875
</ dd >
868
876
< dt id ="supertokens_python.querier.Querier.send_delete_request "> < code class ="name flex ">
869
- < span > async def < span class ="ident "> send_delete_request</ span > </ span > (< span > self, path: NormalisedURLPath, params: Union[Dict[str, Any], None] = None)</ span >
877
+ < span > async def < span class ="ident "> send_delete_request</ span > </ span > (< span > self, path: NormalisedURLPath, params: Union[Dict[str, Any], None] = None) ‑ > Dict[str, Any] </ span >
870
878
</ code > </ dt >
871
879
< dd >
872
880
< div class ="desc "> </ div >
@@ -876,7 +884,7 @@ <h3>Methods</h3>
876
884
</ summary >
877
885
< pre > < code class ="python "> async def send_delete_request(
878
886
self, path: NormalisedURLPath, params: Union[Dict[str, Any], None] = None
879
- ):
887
+ ) -> Dict[str, Any] :
880
888
if params is None:
881
889
params = {}
882
890
@@ -893,7 +901,7 @@ <h3>Methods</h3>
893
901
</ details >
894
902
</ dd >
895
903
< dt id ="supertokens_python.querier.Querier.send_get_request "> < code class ="name flex ">
896
- < span > async def < span class ="ident "> send_get_request</ span > </ span > (< span > self, path: NormalisedURLPath, params: Union[Dict[str, Any], None] = None)</ span >
904
+ < span > async def < span class ="ident "> send_get_request</ span > </ span > (< span > self, path: NormalisedURLPath, params: Union[Dict[str, Any], None] = None) ‑ > Dict[str, Any] </ span >
897
905
</ code > </ dt >
898
906
< dd >
899
907
< div class ="desc "> </ div >
@@ -903,7 +911,7 @@ <h3>Methods</h3>
903
911
</ summary >
904
912
< pre > < code class ="python "> async def send_get_request(
905
913
self, path: NormalisedURLPath, params: Union[Dict[str, Any], None] = None
906
- ):
914
+ ) -> Dict[str, Any] :
907
915
if params is None:
908
916
params = {}
909
917
@@ -920,7 +928,7 @@ <h3>Methods</h3>
920
928
</ details >
921
929
</ dd >
922
930
< dt id ="supertokens_python.querier.Querier.send_post_request "> < code class ="name flex ">
923
- < span > async def < span class ="ident "> send_post_request</ span > </ span > (< span > self, path: NormalisedURLPath, data: Union[Dict[str, Any], None] = None, test: bool = False)</ span >
931
+ < span > async def < span class ="ident "> send_post_request</ span > </ span > (< span > self, path: NormalisedURLPath, data: Union[Dict[str, Any], None] = None, test: bool = False) ‑ > Dict[str, Any] </ span >
924
932
</ code > </ dt >
925
933
< dd >
926
934
< div class ="desc "> </ div >
@@ -933,7 +941,7 @@ <h3>Methods</h3>
933
941
path: NormalisedURLPath,
934
942
data: Union[Dict[str, Any], None] = None,
935
943
test: bool = False,
936
- ):
944
+ ) -> Dict[str, Any] :
937
945
if data is None:
938
946
data = {}
939
947
@@ -960,7 +968,7 @@ <h3>Methods</h3>
960
968
</ details >
961
969
</ dd >
962
970
< dt id ="supertokens_python.querier.Querier.send_put_request "> < code class ="name flex ">
963
- < span > async def < span class ="ident "> send_put_request</ span > </ span > (< span > self, path: NormalisedURLPath, data: Union[Dict[str, Any], None] = None)</ span >
971
+ < span > async def < span class ="ident "> send_put_request</ span > </ span > (< span > self, path: NormalisedURLPath, data: Union[Dict[str, Any], None] = None) ‑ > Dict[str, Any] </ span >
964
972
</ code > </ dt >
965
973
< dd >
966
974
< div class ="desc "> </ div >
@@ -970,7 +978,7 @@ <h3>Methods</h3>
970
978
</ summary >
971
979
< pre > < code class ="python "> async def send_put_request(
972
980
self, path: NormalisedURLPath, data: Union[Dict[str, Any], None] = None
973
- ):
981
+ ) -> Dict[str, Any] :
974
982
if data is None:
975
983
data = {}
976
984
0 commit comments