Tag: request

  • How to reformat result of using curlify lib for request?

    How to reformat result of using curlify lib for request?

    0 Pyrhon, GraphQL, Allure Reports, Requests. I need to attach request details to my repotr. I use curlify lib, but can’t reformat result to make in easy to read. import curlify def def api_request(method=’POST’, **kwargs): with allure.step(f"{method.upper()}{base_url}"): with sessions.Session() as session: response = session.request(method=method, url=base_url, **kwargs) message = to_curl(response.request) allure.attach( body=message.encode("utf-8"), name="Curl", attachment_type=AttachmentType.TEXT, extension=’txt’ And…