Advertisement
Guest User

Untitled

a guest
Jun 10th, 2023
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. @allure.step("Отправить POST запрос")
  2. def post(self, url: str, endpoint: str, params: dict = None, json_body: dict = None, **kwargs):
  3.     with allure.step(f"POST запрос на url: {url}{endpoint}"
  4.                      f"\n тело запроса: \n {json_body}"):
  5.         self.response = requests.post(url=f"{url}{endpoint}",
  6.                                       params=params,
  7.                                       json=json_body,
  8.                                       timeout=self._TIMEOUT,
  9.                                       **kwargs)
  10.     log(response=self.response, request_body=json_body)
  11.     return self
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement