MCPcopy Index your code
hub / github.com/dataforseo/PythonClient / call_api

Method call_api

dataforseo_client/api_client.py:222–255  ·  view source on GitHub ↗

Makes the HTTP request (synchronous) :param method: Method to call. :param url: Path to method endpoint. :param header_params: Header parameters to be placed in the request header. :param body: Request body. :param post_params dict: Request post fo

(
        self,
        method,
        url,
        header_params=None,
        body=None,
        post_params=None,
        _request_timeout=None
    )

Source from the content-addressed store, hash-verified

220
221
222 def call_api(
223 self,
224 method,
225 url,
226 header_params=None,
227 body=None,
228 post_params=None,
229 _request_timeout=None
230 ) -> rest.RESTResponse:
231 """Makes the HTTP request (synchronous)
232 :param method: Method to call.
233 :param url: Path to method endpoint.
234 :param header_params: Header parameters to be
235 placed in the request header.
236 :param body: Request body.
237 :param post_params dict: Request post form parameters,
238 for `application/x-www-form-urlencoded`, `multipart/form-data`.
239 :param _request_timeout: timeout setting for this request.
240 :return: RESTResponse
241 """
242
243 try:
244 # perform request and return response
245 response_data = self.rest_client.request(
246 method, url,
247 headers=header_params,
248 body=body, post_params=post_params,
249 _request_timeout=_request_timeout
250 )
251
252 except ApiException as e:
253 raise e
254
255 return response_data
256
257 def response_deserialize(
258 self,

Calls 1

requestMethod · 0.80

Tested by

no test coverage detected