<p dir="auto">I want to create all HTTP methods requests and fetch the response data with Playwright. Is there any way by which we can achieve this with Playwright or do we need to go for other API libraries for making API request?</p>
<p dir="auto">I currently use Cypress for my automation testing framework, however I am toying with the idea of moving over to Playwright. One feature of cypress that really shines in the ability to make HttpRequests using the <a href="https://docs.cypress.io/api/commands/request" rel="nofollow">cy.request()</a> function, I use this many times throughout the current system however the most important request is used to setup my randomly generated user application state before I even visit the web-app itself (it makes the request to our webServer which responds with data that is then used for the user-specific localStorage items), this allows me to skip the login screen of my application entirely, saving a lot of time for each test.</p>
<p dir="auto">I have read the docs about how Playwright can re-use application state but this is not really a viable solution for me because after each test I specifically use new application state.</p>
<p dir="auto">TLDR: Is it possible to make an HttpRequest through Playwright and get its response?</p>