Path: csiph.com!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Mild Shock Newsgroups: comp.lang.javascript Subject: Re: ANN: Dogelog Player 1.1.6 (HTTP Client) Date: Mon, 11 Mar 2024 09:07:44 +0100 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Mon, 11 Mar 2024 08:07:43 -0000 (UTC) Injection-Info: solani.org; logging-data="1280677"; mail-complaints-to="abuse@news.solani.org" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.18.1 Cancel-Lock: sha1:wA2+bvEPPFQSYVvcnLT5OgZOr7o= In-Reply-To: X-User-ID: eJwNyMEBACAEBdCVCB/jSNl/hLq8wzMBo11hUBubDOLmNqGKmbMN2YDH8sSttel66y9R+8ZUFpPSGjl9dPoBREYVcw== Xref: csiph.com comp.lang.javascript:124285 Its straight forward: async function postData(url = "", data = {}) { const response = await fetch(url, { method: "POST", [...] body: /* put your upload content here */ Mild Shock schrieb: > Do you mean POST requests? > You can do them also with fetch: > > There is a POST example as the first fetch example: > https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch > > So you can use fetch also for upload. > Not only for download. > > Lawrence D'Oliveiro schrieb: >> On Sun, 10 Mar 2024 23:49:38 +0100, Mild Shock wrote: >> >>> First of all XMLHttpRequests is deprecated in the browser, use fetch() >>> instead. >> >> I don’t know why you would say that. Fetch is only for downloads >> , while >> XMLHttpRequest works in both directions >> . >> >