<p dir="auto">Deno doesn't seem to have a way to do a POST fetch that includes an openssl cert file and key? This is how it would be done in Python</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#!/usr/bin/env python
 
import requests
  
payload = 'username=myusername&amp;password=password'
headers = {Content-Type': 'application/x-www-form-urlencoded'}
 
resp = requests.post('https://example.com', data=payload, cert=('client-2048.crt', 'client-2048.key'), headers=headers)"><pre class="notranslate"><code class="notranslate">#!/usr/bin/env python
 
import requests
  
payload = 'username=myusername&amp;password=password'
headers = {Content-Type': 'application/x-www-form-urlencoded'}
 
resp = requests.post('https://example.com', data=payload, cert=('client-2048.crt', 'client-2048.key'), headers=headers)
</code></pre></div>
<p dir="auto">I imagined it working something like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    const response = await fetch(
        url,
        {
            method: &quot;POST&quot;,
            headers: { &quot;Content-Type&quot;: &quot;application/x-www-form-urlencoded&quot;,&quot;X-Application&quot;: appkey},
            cert:'client-2048.crt', 
            key:'client-2048.key',
            body: form,
        },
    );
    return response.json();"><pre class="notranslate"><code class="notranslate">    const response = await fetch(
        url,
        {
            method: "POST",
            headers: { "Content-Type": "application/x-www-form-urlencoded","X-Application": appkey},
            cert:'client-2048.crt', 
            key:'client-2048.key',
            body: form,
        },
    );
    return response.json();
</code></pre></div>
<p dir="auto">However there is no cert or key for <code class="notranslate">RequestInit()</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="No overload matches this call.
  Overload 1 of 2, '(input: string | Request | URL, init?: RequestInit | undefined): Promise&lt;Response&gt;', gave the following error.
    Argument of type '{ method: string; headers: { &quot;Content-Type&quot;: string; &quot;X-Application&quot;: string; }; cert: string; key: string; body: FormData; }' is not assignable to parameter of type 'RequestInit'.
      Object literal may only specify known properties, and 'cert' does not exist in type 'RequestInit'.  Overload 2 of 2, '(input: string | Request | URL, init?: (RequestInit &amp; { client: HttpClient; }) | undefined): Promise&lt;Response&gt;', gave the following error.
    Argument of type '{ method: string; headers: { &quot;Content-Type&quot;: string; &quot;X-Application&quot;: string; }; cert: string; key: string; body: FormData; }' is not assignable to parameter of type 'RequestInit &amp; { client: HttpClient; }'.
      Object literal may only specify known properties, and 'cert' does not exist in type 'RequestInit &amp; { client: HttpClient; }'.deno-ts(2769)"><pre class="notranslate"><code class="notranslate">No overload matches this call.
  Overload 1 of 2, '(input: string | Request | URL, init?: RequestInit | undefined): Promise&lt;Response&gt;', gave the following error.
    Argument of type '{ method: string; headers: { "Content-Type": string; "X-Application": string; }; cert: string; key: string; body: FormData; }' is not assignable to parameter of type 'RequestInit'.
      Object literal may only specify known properties, and 'cert' does not exist in type 'RequestInit'.  Overload 2 of 2, '(input: string | Request | URL, init?: (RequestInit &amp; { client: HttpClient; }) | undefined): Promise&lt;Response&gt;', gave the following error.
    Argument of type '{ method: string; headers: { "Content-Type": string; "X-Application": string; }; cert: string; key: string; body: FormData; }' is not assignable to parameter of type 'RequestInit &amp; { client: HttpClient; }'.
      Object literal may only specify known properties, and 'cert' does not exist in type 'RequestInit &amp; { client: HttpClient; }'.deno-ts(2769)
</code></pre></div>
<p dir="auto">Just like <code class="notranslate">curl --cert &lt;file.pem&gt;</code>.</p>
<p dir="auto">Now the way to solve this problem in deno is: curl. But this method is not cross-platform.</p>