@exceptionless/fetchclient
Advanced tools
Comparing version 0.31.0 to 0.32.0
@@ -269,5 +269,16 @@ import { Counter } from "./Counter.js"; | ||
method: "DELETE", | ||
headers: options?.headers ?? {}, | ||
headers: { "Content-Type": "application/json", ...options?.headers }, | ||
}); | ||
} | ||
/** | ||
* Sends a DELETE request with JSON payload to the specified URL. | ||
* | ||
* @template T - The type of the response data. | ||
* @param {string} url - The URL to send the request to. | ||
* @param {RequestOptions} [options] - Additional options for the request. | ||
* @returns {Promise<FetchClientResponse<T>>} - A promise that resolves to the response data. | ||
*/ | ||
deleteJSON(url, options) { | ||
return this.delete(url, options); | ||
} | ||
async validate(data, options) { | ||
@@ -274,0 +285,0 @@ if (typeof data !== "object" || |
{ | ||
"name": "@exceptionless/fetchclient", | ||
"version": "0.31.0", | ||
"version": "0.32.0", | ||
"description": "A simple fetch client with middleware support for Deno and the browser.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -272,5 +272,16 @@ "use strict"; | ||
method: "DELETE", | ||
headers: options?.headers ?? {}, | ||
headers: { "Content-Type": "application/json", ...options?.headers }, | ||
}); | ||
} | ||
/** | ||
* Sends a DELETE request with JSON payload to the specified URL. | ||
* | ||
* @template T - The type of the response data. | ||
* @param {string} url - The URL to send the request to. | ||
* @param {RequestOptions} [options] - Additional options for the request. | ||
* @returns {Promise<FetchClientResponse<T>>} - A promise that resolves to the response data. | ||
*/ | ||
deleteJSON(url, options) { | ||
return this.delete(url, options); | ||
} | ||
async validate(data, options) { | ||
@@ -277,0 +288,0 @@ if (typeof data !== "object" || |
@@ -133,2 +133,11 @@ import type { GetRequestOptions, RequestOptions } from "./RequestOptions.js"; | ||
delete(url: string, options?: RequestOptions): Promise<FetchClientResponse<unknown>>; | ||
/** | ||
* Sends a DELETE request with JSON payload to the specified URL. | ||
* | ||
* @template T - The type of the response data. | ||
* @param {string} url - The URL to send the request to. | ||
* @param {RequestOptions} [options] - Additional options for the request. | ||
* @returns {Promise<FetchClientResponse<T>>} - A promise that resolves to the response data. | ||
*/ | ||
deleteJSON<T>(url: string, options?: RequestOptions): Promise<FetchClientResponse<T>>; | ||
private validate; | ||
@@ -135,0 +144,0 @@ private fetchInternal; |
Sorry, the diff of this file is not supported yet
190142
2611
110