Search... Ctrl + K

Send PUT Request (http)
One script reply has been approved by the moderators Verified

Created by maximelambercier 187 days ago Used 103 times 0 Points

No comments yet

Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
export async function main(url: string, body: object = {}) {
	const resp = await fetch(url, {
		method: "PUT",
		headers: {
			"Content-Type": "application/json",
		},
		body: JSON.stringify(body),
	});

	return {
		ok: resp.ok,
		status: resp.status,
		text: await resp.text(),
	};
}

Submitted by jaller94 122 days ago

Edited 122 days ago

No comments yet