playwright_put
Execute HTTP PUT requests with specified data to a target URL using browser automation capabilities, enabling advanced web interactions and seamless data updates.
Instructions
Perform an HTTP PUT request
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to perform PUT operation | |
| value | Yes | Data to PUT in the body |
Input Schema (JSON Schema)
{
"properties": {
"url": {
"description": "URL to perform PUT operation",
"type": "string"
},
"value": {
"description": "Data to PUT in the body",
"type": "string"
}
},
"required": [
"url",
"value"
],
"type": "object"
}
Implementation Reference
- src/toolsHandler.ts:379-411 (handler)Implementation of the playwright_put tool handler, which sends a PUT request to the specified URL with JSON data using Playwright's APIRequestContext and returns the response details.case "playwright_put": try { var data = { data: args.value, headers: { 'Content-Type': 'application/json' } }; var response = await apiContext!.put(args.url, data); return { content: [{ type: "text", text: `Performed PUT 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 PUT operation on ${args.url}: ${(error as Error).message}`, }], isError: true, }; }