@@ -115,7 +115,7 @@ async def send_and_read_and_process(
115115 self ,
116116 message : Soup .Message ,
117117 check_common : bool = True ,
118- json : bool = True ,
118+ return_json : bool = True ,
119119 ) -> Any :
120120 """
121121 Helper mixing ``SoupProvider.send_and_read``, ``SoupProvider.send_and_read_json``
@@ -126,14 +126,14 @@ async def send_and_read_and_process(
126126 Args:
127127 message: Message to send.
128128 check_common: If response data should be checked for errors using check_known_errors.
129- json : If data should be processed as JSON.
129+ return_json : If the response should be parsed as JSON.
130130
131131 Returns:
132132 The JSON deserialized to a python object or bytes if ``json`` is ``False``.
133133 """
134134
135135 try :
136- if json :
136+ if return_json :
137137 response = await self .send_and_read_json (message )
138138 else :
139139 response = await self .send_and_read (message )
@@ -153,7 +153,7 @@ async def request(
153153 headers : dict = {},
154154 form : bool = False ,
155155 check_common : bool = True ,
156- json : bool = True ,
156+ return_json : bool = True ,
157157 ) -> Any :
158158 """
159159 Helper for regular HTTP request.
@@ -165,36 +165,34 @@ async def request(
165165 headers: HTTP headers of the message.
166166 form: If the data should be encoded as a form.
167167 check_common: If response data should be checked for errors using check_known_errors.
168- json : If data should be processed as JSON.
168+ return_json : If the response should be parsed as JSON.
169169
170170 Returns:
171171 The JSON deserialized to a python object or bytes if ``json`` is ``False``.
172172 """
173173 message = self .create_message (method , url , data , headers , form )
174- return await self .send_and_read_and_process (message , check_common , json )
174+ return await self .send_and_read_and_process (message , check_common , return_json )
175175
176176 async def get (
177177 self ,
178178 url : str ,
179179 headers : dict = {},
180- form : bool = False ,
181180 check_common : bool = True ,
182- json : bool = True ,
181+ return_json : bool = True ,
183182 ) -> Any :
184183 """
185184 Helper for GET HTTP request.
186185
187186 Args:
188187 url: Url of the request.
189188 headers: HTTP headers of the message.
190- form: If the data should be encoded as a form.
191189 check_common: If response data should be checked for errors using check_known_errors.
192- json : If data should be processed as JSON.
190+ return_json : If the response should be parsed as JSON.
193191
194192 Returns:
195193 The JSON deserialized to a python object or bytes if ``json`` is ``False``.
196194 """
197- return await self .request ("GET" , url , headers = headers , form = form , check_common = check_common , json = json )
195+ return await self .request ("GET" , url , headers = headers , check_common = check_common , return_json = return_json )
198196
199197 async def post (
200198 self ,
@@ -203,7 +201,7 @@ async def post(
203201 headers : dict = {},
204202 form : bool = False ,
205203 check_common : bool = True ,
206- json : bool = True ,
204+ return_json : bool = True ,
207205 ) -> Any :
208206 """
209207 Helper for POST HTTP request.
@@ -214,9 +212,9 @@ async def post(
214212 headers: HTTP headers of the message.
215213 form: If the data should be encoded as a form.
216214 check_common: If response data should be checked for errors using check_known_errors.
217- json : If data should be processed as JSON.
215+ return_json : If the response should be parsed as JSON.
218216
219217 Returns:
220218 The JSON deserialized to a python object or bytes if ``json`` is ``False``.
221219 """
222- return await self .request ("POST" , url , data , headers , form , check_common , json )
220+ return await self .request ("POST" , url , data , headers , form , check_common , return_json )
0 commit comments