# What's New?

## 7.0.0

### CFHttp HTTP Client

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

Previously, these responses were returned as `504 Gateway Timeout` responses. Hyper now normalizes the responses from the different CFML engines into a consistent response. `502 Bad Gateway` is returned instead of `504 Gateway Timeout` for invalid hosts. `408 Request Timeout` is returned if the request takes longer than the configured [`timeout`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#settimeout) value.

### Breaking Changes

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).

## 6.1.0

Add [`head`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#head) and [`options`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#options) shortcut methods.

## 6.0.0

* Add `xml` support and an `asXML` method to set the body format and `Content-Type` header.
* Add `adobe@2023` to testing matrix.

### Breaking Changes

* Remove default `Content-Type` header. 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 `adobe@2016` support.

## 5.0.1

Correctly handle cases when the `body` is a string and format is `JSON`.

## 5.0.0

Add a `debug` method to see what the HTTP client generates.

### Breaking Changes

`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 );
```

## 4.0.3

* Do not prepend the base url when a full url is passed.
* Add `resolveUrls` and `encodeUrl` properties to the [memento](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#getmemento).
* Correctly set the `encodeUrl` property when cloning a request.

## 4.0.2

Update README for builder `initWith` headers losing `Content-Type`.

## 4.0.1

Fix `HyperBuilder` example in the docs.

## 4.0.0

Allow adding multiple query params with the same key.

### Breaking Changes

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) |

## 3.6.2

Convert array values correctly when sending form fields

## 3.6.1

Add a workaround for CommandBox not having the `box:asyncManager` injection DSL.

## 3.6.0

Add async requests using ColdBox's [AsyncManager](https://coldbox.ortusbooks.com/digging-deeper/promises-async-programming).

## 3.5.0

* Provide more useful error than cfhttp when [`throwOnErrors`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#throwerrors) is enabled.
* Provide mementos for [HyperRequest](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#getmemento) and [HyperResponse](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperresponse#getmemento) instances.
* Capture [statusText](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperresponse#getstatustext) and provide a [status](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperresponse#getstatus) convenience string.

## 3.4.2

Add MIT License file

## 3.4.1

Use `processState` over `announce` until CommandBox can update its `interceptorService`.

## 3.4.0

### HyperRequest

* Add [`forwardHeaders`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#forwardheaders) shortcut method.

### HyperResponse

* Allow for default values in [`getHeader`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperresponse#getheader).
* Add helper methods for checking for specific status codes:
  * [`isOk`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperresponse#isok)
  * [`isUnauthorized`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperresponse#isunauthorized)
  * [`isForbidden`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperresponse#isforbidden)
  * [`isNotFound`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperresponse#isnotfound)

## 3.3.0

Allowing [attaching](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#attach) file uploads.

## 3.2.1

Support WireBox outside of ColdBox.

## 3.2.0

Include response data as detail in `DeserializeJsonException`.

## 3.1.0

* Add [`clone`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#clone) to quickly copy `HyperRequest` instances.
* Add interceptors and [local](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#withrequestcallback) [callbacks](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#withresponsecallback) for lifecycle events.

## 3.0.0

Add execution time to `HyperResponse` instances.

### Breaking Changes

Dropped support for ColdBox 5.

## 2.3.11

* Add support for [NTLM authentication](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#withntlmauth).
* Include [`getFullURL`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#getfullurl) method in docs.

## 2.3.10

Fixed typo of `Bulider` to `Builder`.

## 2.3.9

Add [`withoutEncodingUrl`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#withoutencodingurl) flag.

## 2.3.8

Do not fail fast on cron job actions on CI.

## 2.3.7

Update fetch-depth for tests and release actions on CI.

## 2.3.6

Attempt to skip committing back changes on CI.

## 2.3.5

Add matrix and cron testing on CI.

## 2.3.4

Use better GitHub token on CI

## 2.3.1

Add workaround for `boolean` values in query strings.

## 2.3.0

Add [certificate](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#withcertificateauth) auth.

## 2.2.1

Use the previous host for redirect if redirect does not include a full URL.

## 2.2.0

Add [`resolveUrls`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#setresolveurl) flag.

## 2.1.1

* Use OpenJDK instead of OracleJDK on CI.
* Store module in [ForgeBox Storage](https://app.gitbook.com/s/zv049Bp1C22bLDcQ1fZC/developing-for-commandbox/commands).

## 2.1.0

Allow for pluggable [HTTP Clients](https://hyper.ortusbooks.com/7.0.0-2/customizing-hyper/custom-http-clients) that follow the `HyperHttpClientInterface`. (Clients do not need to use the `implements` keyword.)

## 2.0.2

Avoid double encoding using [`cfhttpparam`](https://cfdocs.org/cfhttpparam).

## 2.0.1

Remove Lucee 4.5 support from docs. (Support was dropped in [v2.0.0](#2.0.0))

## 2.0.0

* Do not include [`username`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#setusername) and [`password`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#setpassword) unless they have values.
* Add `adobe@2018` support to CI builds.

### Breaking Changes

Dropped support for `lucee@4.5`.

## 1.15.0

Add [`throwOnError`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#throwerrors) flag.

## 1.14.5

Use `504 Gateway Timeout` for incomplete responses.

## 1.14.4

Include equal signs in query param values.

## 1.14.0 – 1.0.0

### New Features

* Add [`when`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#when) helper to execute conditions without breaking chaining.
* Add [`clear`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#clear) method to reset HyperRequest instances.
* Add configurable [`timeout`](https://hyper.ortusbooks.com/7.0.0-2/making-requests/hyperrequest#settimeout).

### Bug Fixes

* Fix for Lucee 4 compatibility on `LinkedHashMaps` and `keyArray`.
* Preserve case in header names.
* Preserve case for query parameters.
* Serialize both params from the url and set on the `HyperRequest` instance.
* Default to `UTF-8` charset if none is present in the response.
* Fix withHeaders and withQueryParams for Lucee compatibility.
* Only map HyperBuilder as a singleton in WireBox

### Other

* Migrate to [coldbox-modules](https://github.com/coldbox-modules) organization on GitHub.
* Update `box.json` description.
* Enable [CommandBox Semantic Release](https://forgebox.io/view/commandbox-semantic-release) on CI.
