LogoLogo
7.3.0
7.3.0
  • Introduction
  • What's New?
  • Upgrade Guide
  • Getting Started
    • Requirements
    • Installation
  • Making Requests
    • HyperBuilder
    • HyperRequest
    • HyperResponse
  • Customizing Hyper
    • Hyper Clients
    • Custom HTTP Clients
      • CfhttpHttpClient
  • Testing
    • Faking Requests
  • ForgeBox
  • GitHub
Powered by GitBook
On this page
  1. Customizing Hyper

Custom HTTP Clients

By default, Hyper makes HTTP requests using cfhttp under the hood. This can be swapped out by any compatible HTTP client that follows the HyperHttpClientInterface.

/**
 * Responsible for executing the HyperRequest and mapping it to a HyperResponse
 */
interface displayname="HyperHttpClientInterface" {

	/**
	 * Execute the HyperRequest and map it to a HyperResponse.
	 *
	 * @req     The HyperRequest to execute.
	 *
	 * @returns A HyperResponse of the executed request.
	 */
	public HyperResponse function send( required HyperRequest req );

	/**
	 * 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 );

}
PreviousHyper ClientsNextCfhttpHttpClient