@@ -72,28 +72,83 @@ class _RequestFactory(Generic[_T]):
72
72
errors : BytesIO
73
73
def __init__ (self , * , json_encoder : type [JSONEncoder ] = ..., ** defaults : Any ) -> None : ...
74
74
def request (self , ** request : Any ) -> _T : ...
75
- def get (self , path : str , data : _GetDataType = ..., secure : bool = ..., ** extra : Any ) -> _T : ...
76
- def post (self , path : str , data : Any = ..., content_type : str = ..., secure : bool = ..., ** extra : Any ) -> _T : ...
77
- def head (self , path : str , data : Any = ..., secure : bool = ..., ** extra : Any ) -> _T : ...
78
- def trace (self , path : str , secure : bool = ..., ** extra : Any ) -> _T : ...
75
+ def get (
76
+ self ,
77
+ path : str ,
78
+ data : _GetDataType = ...,
79
+ secure : bool = ...,
80
+ * ,
81
+ headers : dict [str , Any ] | None = ...,
82
+ ** extra : Any
83
+ ) -> _T : ...
84
+ def post (
85
+ self ,
86
+ path : str ,
87
+ data : Any = ...,
88
+ content_type : str = ...,
89
+ secure : bool = ...,
90
+ * ,
91
+ headers : dict [str , Any ] | None = ...,
92
+ ** extra : Any
93
+ ) -> _T : ...
94
+ def head (
95
+ self , path : str , data : Any = ..., secure : bool = ..., * , headers : dict [str , Any ] | None = ..., ** extra : Any
96
+ ) -> _T : ...
97
+ def trace (self , path : str , secure : bool = ..., * , headers : dict [str , Any ] | None = ..., ** extra : Any ) -> _T : ...
79
98
def options (
80
- self , path : str , data : dict [str , str ] | str = ..., content_type : str = ..., secure : bool = ..., ** extra : Any
99
+ self ,
100
+ path : str ,
101
+ data : dict [str , str ] | str = ...,
102
+ content_type : str = ...,
103
+ secure : bool = ...,
104
+ * ,
105
+ headers : dict [str , Any ] | None = ...,
106
+ ** extra : Any
81
107
) -> _T : ...
82
- def put (self , path : str , data : Any = ..., content_type : str = ..., secure : bool = ..., ** extra : Any ) -> _T : ...
83
- def patch (self , path : str , data : Any = ..., content_type : str = ..., secure : bool = ..., ** extra : Any ) -> _T : ...
84
- def delete (self , path : str , data : Any = ..., content_type : str = ..., secure : bool = ..., ** extra : Any ) -> _T : ...
85
- def generic (
86
- self , method : str , path : str , data : Any = ..., content_type : str | None = ..., secure : bool = ..., ** extra : Any
108
+ def put (
109
+ self ,
110
+ path : str ,
111
+ data : Any = ...,
112
+ content_type : str = ...,
113
+ secure : bool = ...,
114
+ * ,
115
+ headers : dict [str , Any ] | None = ...,
116
+ ** extra : Any
117
+ ) -> _T : ...
118
+ def patch (
119
+ self ,
120
+ path : str ,
121
+ data : Any = ...,
122
+ content_type : str = ...,
123
+ secure : bool = ...,
124
+ * ,
125
+ headers : dict [str , Any ] | None = ...,
126
+ ** extra : Any
127
+ ) -> _T : ...
128
+ def delete (
129
+ self ,
130
+ path : str ,
131
+ data : Any = ...,
132
+ content_type : str = ...,
133
+ secure : bool = ...,
134
+ * ,
135
+ headers : dict [str , Any ] | None = ...,
136
+ ** extra : Any
87
137
) -> _T : ...
88
-
89
- class RequestFactory (_RequestFactory [WSGIRequest ]): ...
90
-
91
- class _AsyncRequestFactory (_RequestFactory [_T ]):
92
- def request (self , ** request : Any ) -> _T : ...
93
138
def generic (
94
- self , method : str , path : str , data : Any = ..., content_type : str | None = ..., secure : bool = ..., ** extra : Any
139
+ self ,
140
+ method : str ,
141
+ path : str ,
142
+ data : Any = ...,
143
+ content_type : str | None = ...,
144
+ secure : bool = ...,
145
+ * ,
146
+ headers : dict [str , Any ] | None = ...,
147
+ ** extra : Any
95
148
) -> _T : ...
96
149
150
+ class RequestFactory (_RequestFactory [WSGIRequest ]): ...
151
+ class _AsyncRequestFactory (_RequestFactory [_T ]): ...
97
152
class AsyncRequestFactory (_AsyncRequestFactory [ASGIRequest ]): ...
98
153
99
154
# fakes to distinguish WSGIRequest and ASGIRequest
@@ -130,39 +185,104 @@ class Client(ClientMixin, _RequestFactory[_MonkeyPatchedWSGIResponse]):
130
185
handler : ClientHandler
131
186
raise_request_exception : bool
132
187
exc_info : tuple [type [BaseException ], BaseException , TracebackType ] | None
188
+ extra : dict [str , Any ] | None
189
+ headers : dict [str , Any ]
133
190
def __init__ (
134
- self , enforce_csrf_checks : bool = ..., raise_request_exception : bool = ..., ** defaults : Any
191
+ self ,
192
+ enforce_csrf_checks : bool = ...,
193
+ raise_request_exception : bool = ...,
194
+ * ,
195
+ headers : dict [str , Any ] | None = ...,
196
+ ** defaults : Any
135
197
) -> None : ...
136
- # Silence type warnings, since this class overrides arguments and return types in an unsafe manner.
137
198
def request (self , ** request : Any ) -> _MonkeyPatchedWSGIResponse : ...
138
199
def get ( # type: ignore
139
- self , path : str , data : _GetDataType = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
200
+ self ,
201
+ path : str ,
202
+ data : _GetDataType = ...,
203
+ follow : bool = ...,
204
+ secure : bool = ...,
205
+ * ,
206
+ headers : dict [str , Any ] | None = ...,
207
+ ** extra : Any
140
208
) -> _MonkeyPatchedWSGIResponse : ...
141
209
def post ( # type: ignore
142
- self , path : str , data : Any = ..., content_type : str = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
210
+ self ,
211
+ path : str ,
212
+ data : Any = ...,
213
+ content_type : str = ...,
214
+ follow : bool = ...,
215
+ secure : bool = ...,
216
+ * ,
217
+ headers : dict [str , Any ] | None = ...,
218
+ ** extra : Any
143
219
) -> _MonkeyPatchedWSGIResponse : ...
144
220
def head ( # type: ignore
145
- self , path : str , data : Any = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
221
+ self ,
222
+ path : str ,
223
+ data : Any = ...,
224
+ follow : bool = ...,
225
+ secure : bool = ...,
226
+ * ,
227
+ headers : dict [str , Any ] | None = ...,
228
+ ** extra : Any
146
229
) -> _MonkeyPatchedWSGIResponse : ...
147
230
def trace ( # type: ignore
148
- self , path : str , data : Any = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
231
+ self ,
232
+ path : str ,
233
+ data : Any = ...,
234
+ follow : bool = ...,
235
+ secure : bool = ...,
236
+ * ,
237
+ headers : dict [str , Any ] | None = ...,
238
+ ** extra : Any
149
239
) -> _MonkeyPatchedWSGIResponse : ...
150
240
def put ( # type: ignore
151
- self , path : str , data : Any = ..., content_type : str = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
241
+ self ,
242
+ path : str ,
243
+ data : Any = ...,
244
+ content_type : str = ...,
245
+ follow : bool = ...,
246
+ secure : bool = ...,
247
+ * ,
248
+ headers : dict [str , Any ] | None = ...,
249
+ ** extra : Any
152
250
) -> _MonkeyPatchedWSGIResponse : ...
153
251
def patch ( # type: ignore
154
- self , path : str , data : Any = ..., content_type : str = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
252
+ self ,
253
+ path : str ,
254
+ data : Any = ...,
255
+ content_type : str = ...,
256
+ follow : bool = ...,
257
+ secure : bool = ...,
258
+ * ,
259
+ headers : dict [str , Any ] | None = ...,
260
+ ** extra : Any
155
261
) -> _MonkeyPatchedWSGIResponse : ...
156
262
def delete ( # type: ignore
157
- self , path : str , data : Any = ..., content_type : str = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
263
+ self ,
264
+ path : str ,
265
+ data : Any = ...,
266
+ content_type : str = ...,
267
+ follow : bool = ...,
268
+ secure : bool = ...,
269
+ * ,
270
+ headers : dict [str , Any ] | None = ...,
271
+ ** extra : Any
158
272
) -> _MonkeyPatchedWSGIResponse : ...
159
273
160
274
class AsyncClient (ClientMixin , _AsyncRequestFactory [Awaitable [_MonkeyPatchedASGIResponse ]]):
161
275
handler : AsyncClientHandler
162
276
raise_request_exception : bool
163
277
exc_info : Any
164
- extra : Any
278
+ extra : dict [str , Any ] | None
279
+ headers : dict [str , Any ]
165
280
def __init__ (
166
- self , enforce_csrf_checks : bool = ..., raise_request_exception : bool = ..., ** defaults : Any
281
+ self ,
282
+ enforce_csrf_checks : bool = ...,
283
+ raise_request_exception : bool = ...,
284
+ * ,
285
+ headers : dict [str , Any ] | None = ...,
286
+ ** defaults : Any
167
287
) -> None : ...
168
288
async def request (self , ** request : Any ) -> _MonkeyPatchedASGIResponse : ...
0 commit comments