cloudflare
Version:
The official TypeScript library for the Cloudflare API
27 lines • 1.26 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
export class EarlyHints extends APIResource {
/**
* When enabled, Cloudflare will attempt to speed up overall page loads by serving
* `103` responses with `Link` headers from the final response. Refer to
* [Early Hints](https://developers.cloudflare.com/cache/about/early-hints) for
* more information.
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch(`/zones/${zone_id}/settings/early_hints`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* When enabled, Cloudflare will attempt to speed up overall page loads by serving
* `103` responses with `Link` headers from the final response. Refer to
* [Early Hints](https://developers.cloudflare.com/cache/about/early-hints) for
* more information.
*/
get(params, options) {
const { zone_id } = params;
return this._client.get(`/zones/${zone_id}/settings/early_hints`, options)._thenUnwrap((obj) => obj.result);
}
}
(function (EarlyHints) {
})(EarlyHints || (EarlyHints = {}));
//# sourceMappingURL=early-hints.mjs.map