@@ -72,26 +72,95 @@ 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
107
+ ) -> _T : ...
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
81
137
) -> _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
138
def generic (
86
- 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
87
148
) -> _T : ...
88
149
89
150
class RequestFactory (_RequestFactory [WSGIRequest ]): ...
90
151
91
152
class _AsyncRequestFactory (_RequestFactory [_T ]):
92
153
def request (self , ** request : Any ) -> _T : ...
93
154
def generic (
94
- self , method : str , path : str , data : Any = ..., content_type : str | None = ..., secure : bool = ..., ** extra : Any
155
+ self ,
156
+ method : str ,
157
+ path : str ,
158
+ data : Any = ...,
159
+ content_type : str | None = ...,
160
+ secure : bool = ...,
161
+ * ,
162
+ headers : dict [str , Any ] | None = ...,
163
+ ** extra : Any
95
164
) -> _T : ...
96
165
97
166
class AsyncRequestFactory (_AsyncRequestFactory [ASGIRequest ]): ...
@@ -130,39 +199,104 @@ class Client(ClientMixin, _RequestFactory[_MonkeyPatchedWSGIResponse]):
130
199
handler : ClientHandler
131
200
raise_request_exception : bool
132
201
exc_info : tuple [type [BaseException ], BaseException , TracebackType ] | None
202
+ extra : Any
203
+ headers : dict [str , Any ]
133
204
def __init__ (
134
- self , enforce_csrf_checks : bool = ..., raise_request_exception : bool = ..., ** defaults : Any
205
+ self ,
206
+ enforce_csrf_checks : bool = ...,
207
+ raise_request_exception : bool = ...,
208
+ * ,
209
+ headers : dict [str , Any ] | None = ...,
210
+ ** defaults : Any
135
211
) -> None : ...
136
- # Silence type warnings, since this class overrides arguments and return types in an unsafe manner.
137
212
def request (self , ** request : Any ) -> _MonkeyPatchedWSGIResponse : ...
138
213
def get ( # type: ignore
139
- self , path : str , data : _GetDataType = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
214
+ self ,
215
+ path : str ,
216
+ data : _GetDataType = ...,
217
+ follow : bool = ...,
218
+ secure : bool = ...,
219
+ * ,
220
+ headers : dict [str , Any ] | None ,
221
+ ** extra : Any
140
222
) -> _MonkeyPatchedWSGIResponse : ...
141
223
def post ( # type: ignore
142
- self , path : str , data : Any = ..., content_type : str = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
224
+ self ,
225
+ path : str ,
226
+ data : Any = ...,
227
+ content_type : str = ...,
228
+ follow : bool = ...,
229
+ secure : bool = ...,
230
+ * ,
231
+ headers : dict [str , Any ] | None ,
232
+ ** extra : Any
143
233
) -> _MonkeyPatchedWSGIResponse : ...
144
234
def head ( # type: ignore
145
- self , path : str , data : Any = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
235
+ self ,
236
+ path : str ,
237
+ data : Any = ...,
238
+ follow : bool = ...,
239
+ secure : bool = ...,
240
+ * ,
241
+ headers : dict [str , Any ] | None ,
242
+ ** extra : Any
146
243
) -> _MonkeyPatchedWSGIResponse : ...
147
244
def trace ( # type: ignore
148
- self , path : str , data : Any = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
245
+ self ,
246
+ path : str ,
247
+ data : Any = ...,
248
+ follow : bool = ...,
249
+ secure : bool = ...,
250
+ * ,
251
+ headers : dict [str , Any ] | None ,
252
+ ** extra : Any
149
253
) -> _MonkeyPatchedWSGIResponse : ...
150
254
def put ( # type: ignore
151
- self , path : str , data : Any = ..., content_type : str = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
255
+ self ,
256
+ path : str ,
257
+ data : Any = ...,
258
+ content_type : str = ...,
259
+ follow : bool = ...,
260
+ secure : bool = ...,
261
+ * ,
262
+ headers : dict [str , Any ] | None ,
263
+ ** extra : Any
152
264
) -> _MonkeyPatchedWSGIResponse : ...
153
265
def patch ( # type: ignore
154
- self , path : str , data : Any = ..., content_type : str = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
266
+ self ,
267
+ path : str ,
268
+ data : Any = ...,
269
+ content_type : str = ...,
270
+ follow : bool = ...,
271
+ secure : bool = ...,
272
+ * ,
273
+ headers : dict [str , Any ] | None ,
274
+ ** extra : Any
155
275
) -> _MonkeyPatchedWSGIResponse : ...
156
276
def delete ( # type: ignore
157
- self , path : str , data : Any = ..., content_type : str = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
277
+ self ,
278
+ path : str ,
279
+ data : Any = ...,
280
+ content_type : str = ...,
281
+ follow : bool = ...,
282
+ secure : bool = ...,
283
+ * ,
284
+ headers : dict [str , Any ] | None ,
285
+ ** extra : Any
158
286
) -> _MonkeyPatchedWSGIResponse : ...
159
287
160
288
class AsyncClient (ClientMixin , _AsyncRequestFactory [Awaitable [_MonkeyPatchedASGIResponse ]]):
161
289
handler : AsyncClientHandler
162
290
raise_request_exception : bool
163
291
exc_info : Any
164
292
extra : Any
293
+ headers : dict [str , Any ]
165
294
def __init__ (
166
- self , enforce_csrf_checks : bool = ..., raise_request_exception : bool = ..., ** defaults : Any
295
+ self ,
296
+ enforce_csrf_checks : bool = ...,
297
+ raise_request_exception : bool = ...,
298
+ * ,
299
+ headers : dict [str , Any ] | None = ...,
300
+ ** defaults : Any
167
301
) -> None : ...
168
302
async def request (self , ** request : Any ) -> _MonkeyPatchedASGIResponse : ...
0 commit comments