Documentation Index
Fetch the curated documentation index at: https://grafana_com_website/llms.txt
Fetch the complete documentation index at: https://grafana_com_website/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: /docs/k6/next/javascript-api/k6-http/response/response-json.md (append .md) or send Accept: text/markdown to /docs/k6/next/javascript-api/k6-http/response/response-json/. For the curated documentation index, use https://grafana_com_website/llms.txt. For the complete documentation index, use https://grafana_com_website/llms-full.txt.
This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
Response.json( [selector] )
Parses the response body data as JSON and returns a JS object or array. This call caches the deserialized JSON data, additional calls will return the cached data. An optional selector can be specified to extract a specific part of the data, see here for selector syntax.
This method takes an object argument where the following properties can be set:
| Param | Type | Description |
|---|---|---|
| selector | string | An optional selector can be specified to extract a specific part of the data, see here for selector syntax. |
Returns
| Type | Description |
|---|---|
| Object or array | Returns the response body as JSON object. |
Example
import http from 'k6/http';
export default function () {
const res = http.get('https://quickpizza.grafana.com/api/json?foo=bar');
console.log(res.json());
}Was this page helpful?
Related resources from Grafana Labs

