BTBrowserTools

cURL to Playwright API Request Converter

Convert browser DevTools cURL commands into idiomatic Playwright request.get() and request.post() TypeScript code.

Instant Execution · No Sign-Up
100% In-Browser Processing (Zero Server Uploads)

How to Use cURL to Playwright API Request Converter

  1. 1

    Paste cURL Command

    Copy a network request as cURL (bash) from Chrome or Firefox DevTools and paste it into the input box.

  2. 2

    Parse Headers, Auth & Payload

    Click Run Tool to extract HTTP methods, bearer tokens, cookies, query params, and JSON or form bodies.

  3. 3

    Copy Playwright Test Code

    Copy the generated async Playwright APIRequestContext snippet straight into your test spec.

Frequently Asked Questions

How does Playwright handle JSON bodies compared to cURL?

Instead of passing raw strings with manual Content-Type headers, Playwright's request context accepts a clean data object and automatically serializes JSON payloads.

Are Authorization headers and cookies preserved?

Yes. All -H headers, Basic/Bearer auth flags (-u), and Cookie headers are mapped into Playwright's headers configuration object.

Is my authentication token safe when converting cURL commands?

Yes. The parser runs strictly inside your browser with zero server logging, protecting session cookies and bearer tokens.

Related Free Tools