MCPcopy Index your code
hub / github.com/praw-dev/praw / _objectify_request

Method _objectify_request

praw/reddit.py:466–500  ·  view source on GitHub ↗

Run a request through the ``Objector``. :param data: Dictionary, bytes, or file-like object to send in the body of the request (default: ``None``). :param files: Dictionary, filename to file (like) object mapping (default: ``None``). :param json: JSON

(
        self,
        *,
        data: dict[str, Any] | bytes | IO | str | None = None,
        files: dict[str, IO] | None = None,
        json: dict[Any, Any] | list[Any] | None = None,
        method: str = "",
        params: dict[str, str | int] | None = None,
        path: str = "",
    )

Source from the content-addressed store, hash-verified

464 return None
465
466 def _objectify_request(
467 self,
468 *,
469 data: dict[str, Any] | bytes | IO | str | None = None,
470 files: dict[str, IO] | None = None,
471 json: dict[Any, Any] | list[Any] | None = None,
472 method: str = "",
473 params: dict[str, str | int] | None = None,
474 path: str = "",
475 ) -> Any:
476 """Run a request through the ``Objector``.
477
478 :param data: Dictionary, bytes, or file-like object to send in the body of the
479 request (default: ``None``).
480 :param files: Dictionary, filename to file (like) object mapping (default:
481 ``None``).
482 :param json: JSON-serializable object to send in the body of the request with a
483 Content-Type header of application/json (default: ``None``). If ``json`` is
484 provided, ``data`` should not be.
485 :param method: The HTTP method (e.g., ``"GET"``, ``"POST"``, ``"PUT"``,
486 ``"DELETE"``).
487 :param params: The query parameters to add to the request (default: ``None``).
488 :param path: The path to fetch.
489
490 """
491 return self._objector.objectify(
492 data=self.request(
493 data=data,
494 files=files,
495 json=json,
496 method=method,
497 params=params,
498 path=path,
499 )
500 )
501
502 def _prepare_common_authorizer(self, authenticator: prawcore.auth.BaseAuthenticator) -> None:
503 if self.config.refresh_token:

Callers 6

deleteMethod · 0.95
getMethod · 0.95
patchMethod · 0.95
postMethod · 0.95
putMethod · 0.95
username_availableMethod · 0.95

Calls 2

requestMethod · 0.95
objectifyMethod · 0.45

Tested by

no test coverage detected