playwright_post
Execute HTTP POST requests to specified URLs with custom data payloads using the MCP Playwright CDP server for browser automation and advanced web interactions.
Instructions
Perform an HTTP POST request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to perform POST operation | |
| value | Yes | Data to post in the body |
Implementation Reference
- src/toolsHandler.ts:344-377 (handler)This is the core handler logic for the 'playwright_post' tool. It constructs a POST request with JSON data from the input arguments, sends it via Playwright's APIRequestContext, and returns the response details (JSON body and status code) or an error message.case "playwright_post": try { var data = { data: args.value, headers: { 'Content-Type': 'application/json' } }; var response = await apiContext!.post(args.url, data); return { content: [{ type: "text", text: `Performed POST Operation ${args.url} with data ${JSON.stringify(args.value, null, 2)}`, }, { type: "text", text: `Response: ${JSON.stringify(await response.json(), null, 2)}`, }, { type: "text", text: `Response code ${response.status()}` }], isError: false, }; } catch (error) { return { content: [{ type: "text", text: `Failed to perform POST operation on ${args.url}: ${(error as Error).message}`, }], isError: true, }; }