# Upgrade Guide

## Upgrading from v6 to v7

### CFHttp HTTP Client

This client now returns more accurate status codes for `502 Bad Gateway` and `408 Request Timeout` responses.

If you were previously checking specifically for `504` status codes for bad hosts, you need to now either check for `502` status codes or use a more general method, like [`isServerError`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperresponse#isservererror) or [`isError`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperresponse#iserror).

If you were previously checking specifically for `504` status codes or [`isServerError`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperresponse#isservererror) for timed out requests, you need to now either check for `408` status codes, [`isClientError`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperresponse#isclienterror), or the more general [`isError`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperresponse#iserror).

## Upgrading from v5 to v6

* The default `Content-Type` header has been removed. You must set this [manually](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#setcontenttype) or use a format helper, such as [`asJson`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#asjson).
* Dropped support for Adobe 2016.

## Upgrading from v4 to v5

`HyperHttpClientInterface` now requires a `debug` method.

```cfscript
/**
 * Return a struct of information showing how the client will execute the HyperRequest.
 * This will be used by a developer to debug any differences between the generated
 * request values and the expected request values.
 *
 * @req     The HyperRequest to debug.
 *
 * @returns A struct of information detailing how the client would execute the HyperRequest.
 */
public struct function debug( required HyperRequest req );
```

## Upgrading from v3 to v4

Previously, query params were stored as a struct.  Some APIs expect multiple values for the same query param name to be passed as separate arguments.  Hyper now stores the query params as an array and provides new methods for interacting with query params:

* [`getQueryParamByName`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#getqueryparambyname)
* [`getAllQueryParamsByName`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#getallqueryparamsbyname)
* [`withQueryParams`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#withqueryparams)
* [`appendQueryParam`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#appendqueryparam)
* [`appendQueryParams`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#appendqueryparams)
* [`hasQueryParam`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#hasqueryparam)

The following methods still exist, but now interact with arrays of query param structs instead of a simple struct.

* [`getQueryParams`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#getqueryparams)
* [`setQueryParams`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#setqueryparams)

The following methods have been deprecated:

| Deprecated Method                                                                                  | Replacement Method                                                                                             |
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| [`getQueryParam`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#getqueryparam) | [`getQueryParamByName`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#getqueryparambyname) |

## Upgrading from v2 to v3

Dropped support for ColdBox 5.

## Upgrading from v1 to v2

Dropped support for Lucee 4.5.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hyper.ortusbooks.com/7.0.0-2/upgrade-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
