Skip to content

Commit

Permalink
Document HTTP headers structure (#1645)
Browse files Browse the repository at this point in the history
* Document HTTP headers structure

---------

Co-authored-by: Heitor Tashiro Sergent <heitortsergent@gmail.com>
Co-authored-by: Mihail Stoykov <312246+mstoykov@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 11, 2024
1 parent 541dd43 commit cd33c27
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 21 deletions.
6 changes: 3 additions & 3 deletions docs/sources/next/javascript-api/k6-http/response/_index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: 'Response'
description: 'Returned by the http.* methods that generate HTTP requests.'
description: 'Returned by the http.* methods that generate HTTP requests.'
weight: 61
weight: 61
---

Expand All @@ -18,7 +16,9 @@ Note that in the case of redirects, all the information in the Response object w
| `Response.cookies` | object | Response cookies. The object properties are the cookie names and the value is an array of cookie objects (with `name`, `value`, `domain`, `path`, `httpOnly`, `secure`, `maxAge` and `expires` fields). |
| `Response.error` | string | Error message if there was a non-HTTP error while trying to send the request. |
| `Response.error_code` | number | [Error code](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/error-codes) if there was a non-HTTP error or 4xx or 5xx HTTP error it will be set to a specific code that describes the error. (Added in 0.24.0) |
| `Response.headers` | object | Key-value pairs representing all HTTP headers sent by the server. Note that the header names are in [canonical form](https://pkg.go.dev/net/http#CanonicalHeaderKey), i.e.: if the server responds with "accept-encoding", the key will be "Accept-Encoding". |
| `Response.headers` | object | Key-value pairs representing all HTTP headers sent by the server. Note that the header names are in [canonical form](https://pkg.go.dev/net/http#CanonicalHeaderKey); for example, if the server responds with "accept-encoding", the key will be "Accept-Encoding". When requesting a header by a specific name, an array of strings is returned since the header can have multiple values. So you can access each value by its index - for the first value (or for single-valued header) that will be `Response.headers["my_key"][0]`.

|
| `Response.ocsp.produced_at` | number | If a stapled OSCP response was provided by server, the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC, representing the time when this OCSP stapled response was signed by CA (or by CA entrusted OCSP responder) |
| `Response.ocsp.this_update` | number | If a stapled OSCP response was provided by server, the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC, representing the time at which the status being indicated was known to be correct. |
| `Response.ocsp.next_update` | number | If a stapled OSCP response was provided by server, the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC, representing the time when this OCSP stapled response will be refreshed with CA (or by CA entrusted OCSP responder). |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: 'Response'
description: 'Returned by the http.* methods that generate HTTP requests.'
description: 'Returned by the http.* methods that generate HTTP requests.'
weight: 61
weight: 61
---

Expand All @@ -18,7 +16,7 @@ Note that in the case of redirects, all the information in the Response object w
| `Response.cookies` | object | Response cookies. The object properties are the cookie names and the value is an array of cookie objects (with `name`, `value`, `domain`, `path`, `httpOnly`, `secure`, `maxAge` and `expires` fields). |
| `Response.error` | string | Error message if there was a non-HTTP error while trying to send the request. |
| `Response.error_code` | number | [Error code](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/error-codes) if there was a non-HTTP error or 4xx or 5xx HTTP error it will be set to a specific code that describes the error. (Added in 0.24.0) |
| `Response.headers` | object | Key-value pairs representing all HTTP headers sent by the server. Note that the header names are in [canonical form](https://pkg.go.dev/net/http#CanonicalHeaderKey), i.e.: if the server responds with "accept-encoding", the key will be "Accept-Encoding". |
| `Response.headers` | object | Key-value pairs representing all HTTP headers sent by the server. Note that the header names are in [canonical form](https://pkg.go.dev/net/http#CanonicalHeaderKey); for example, if the server responds with "accept-encoding", the key will be "Accept-Encoding". When requesting a header by a specific name, an array of strings is returned since the header can have multiple values. So you can access each value by its index - for the first value (or for single-valued header) that will be `Response.headers["my_key"][0]`. |
| `Response.ocsp.produced_at` | number | If a stapled OSCP response was provided by server, the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC, representing the time when this OCSP stapled response was signed by CA (or by CA entrusted OCSP responder) |
| `Response.ocsp.this_update` | number | If a stapled OSCP response was provided by server, the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC, representing the time at which the status being indicated was known to be correct. |
| `Response.ocsp.next_update` | number | If a stapled OSCP response was provided by server, the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC, representing the time when this OCSP stapled response will be refreshed with CA (or by CA entrusted OCSP responder). |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: 'Response'
description: 'Returned by the http.* methods that generate HTTP requests.'
description: 'Returned by the http.* methods that generate HTTP requests.'
weight: 61
weight: 61
---

Expand All @@ -18,7 +16,7 @@ Note that in the case of redirects, all the information in the Response object w
| `Response.cookies` | object | Response cookies. The object properties are the cookie names and the value is an array of cookie objects (with `name`, `value`, `domain`, `path`, `httpOnly`, `secure`, `maxAge` and `expires` fields). |
| `Response.error` | string | Error message if there was a non-HTTP error while trying to send the request. |
| `Response.error_code` | number | [Error code](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/error-codes) if there was a non-HTTP error or 4xx or 5xx HTTP error it will be set to a specific code that describes the error. (Added in 0.24.0) |
| `Response.headers` | object | Key-value pairs representing all HTTP headers sent by the server. Note that the header names are in [canonical form](https://pkg.go.dev/net/http#CanonicalHeaderKey), i.e.: if the server responds with "accept-encoding", the key will be "Accept-Encoding". |
| `Response.headers` | object | Key-value pairs representing all HTTP headers sent by the server. Note that the header names are in [canonical form](https://pkg.go.dev/net/http#CanonicalHeaderKey); for example, if the server responds with "accept-encoding", the key will be "Accept-Encoding". When requesting a header by a specific name, an array of strings is returned since the header can have multiple values. So you can access each value by its index - for the first value (or for single-valued header) that will be `Response.headers["my_key"][0]`. |
| `Response.ocsp.produced_at` | number | If a stapled OSCP response was provided by server, the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC, representing the time when this OCSP stapled response was signed by CA (or by CA entrusted OCSP responder) |
| `Response.ocsp.this_update` | number | If a stapled OSCP response was provided by server, the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC, representing the time at which the status being indicated was known to be correct. |
| `Response.ocsp.next_update` | number | If a stapled OSCP response was provided by server, the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC, representing the time when this OCSP stapled response will be refreshed with CA (or by CA entrusted OCSP responder). |
Expand Down
Loading

0 comments on commit cd33c27

Please sign in to comment.