---
title: "patch( url, [body], [params] ) | Grafana k6 documentation"
description: "Issue an HTTP PATCH request."
---

# patch( url, \[body], \[params] )

Expand table

| Parameter         | Type                                                                     | Description                                                                                              |
|-------------------|--------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|
| url               | string / [HTTP URL](/docs/k6/latest/javascript-api/k6-http/url/#returns) | Request URL (e.g. `http://example.com`).                                                                 |
| body (optional)   | string / object / ArrayBuffer                                            | Request body; objects will be `x-www-form-urlencoded`.                                                   |
| params (optional) | object                                                                   | [Params](/docs/k6/latest/javascript-api/k6-http/params/) object containing additional request parameters |

### Returns

Expand table

| Type                                                         | Description           |
|--------------------------------------------------------------|-----------------------|
| [Response](/docs/k6/latest/javascript-api/k6-http/response/) | HTTP Response object. |

### Example

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
import http from 'k6/http';

const url = 'https://quickpizza.grafana.com/api/patch';

export default function () {
  const headers = { 'Content-Type': 'application/json' };
  const data = { name: 'Bert' };

  const res = http.patch(url, JSON.stringify(data), { headers: headers });

  console.log(JSON.parse(res.body).name);
}
```
