<p dir="auto">Description:<br>
The signature of the following methods changed from (0.21.4)</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  post&lt;T = any, R = AxiosResponse&lt;T&gt;&gt;(url: string, data?: any, config?: AxiosRequestConfig): Promise&lt;R&gt;;
  put&lt;T = any, R = AxiosResponse&lt;T&gt;&gt;(url: string, data?: any, config?: AxiosRequestConfig): Promise&lt;R&gt;;
  patch&lt;T = any, R = AxiosResponse&lt;T&gt;&gt;(url: string, data?: any, config?: AxiosRequestConfig): Promise&lt;R&gt;;"><pre class="notranslate">  <span class="pl-s1">post</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span> <span class="pl-c1">=</span> <span class="pl-s1">any</span><span class="pl-kos">,</span> <span class="pl-smi">R</span> <span class="pl-c1">=</span> <span class="pl-smi">AxiosResponse</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;&gt;</span><span class="pl-kos">(</span><span class="pl-s1">url</span>: <span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-s1">data</span>?: <span class="pl-smi">any</span><span class="pl-kos">,</span> <span class="pl-s1">config</span>?: <span class="pl-smi">AxiosRequestConfig</span><span class="pl-kos">)</span>: <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi">R</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span>
  <span class="pl-s1">put</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span> <span class="pl-c1">=</span> <span class="pl-s1">any</span><span class="pl-kos">,</span> <span class="pl-smi">R</span> <span class="pl-c1">=</span> <span class="pl-smi">AxiosResponse</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;&gt;</span><span class="pl-kos">(</span><span class="pl-s1">url</span>: <span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-s1">data</span>?: <span class="pl-smi">any</span><span class="pl-kos">,</span> <span class="pl-s1">config</span>?: <span class="pl-smi">AxiosRequestConfig</span><span class="pl-kos">)</span>: <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi">R</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span>
  <span class="pl-s1">patch</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span> <span class="pl-c1">=</span> <span class="pl-s1">any</span><span class="pl-kos">,</span> <span class="pl-smi">R</span> <span class="pl-c1">=</span> <span class="pl-smi">AxiosResponse</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;&gt;</span><span class="pl-kos">(</span><span class="pl-s1">url</span>: <span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-s1">data</span>?: <span class="pl-smi">any</span><span class="pl-kos">,</span> <span class="pl-s1">config</span>?: <span class="pl-smi">AxiosRequestConfig</span><span class="pl-kos">)</span>: <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi">R</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">to (0.22.0)</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  post&lt;T = never, R = AxiosResponse&lt;T&gt;&gt;(url: string, data?: T, config?: AxiosRequestConfig&lt;T&gt;): Promise&lt;R&gt;;
  put&lt;T = never, R = AxiosResponse&lt;T&gt;&gt;(url: string, data?: T, config?: AxiosRequestConfig&lt;T&gt;): Promise&lt;R&gt;;
  patch&lt;T = never, R = AxiosResponse&lt;T&gt;&gt;(url: string, data?: T, config?: AxiosRequestConfig&lt;T&gt;): Promise&lt;R&gt;;"><pre class="notranslate">  <span class="pl-s1">post</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span> <span class="pl-c1">=</span> <span class="pl-s1">never</span><span class="pl-kos">,</span> <span class="pl-smi">R</span> <span class="pl-c1">=</span> <span class="pl-smi">AxiosResponse</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;&gt;</span><span class="pl-kos">(</span><span class="pl-s1">url</span>: <span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-s1">data</span>?: <span class="pl-smi">T</span><span class="pl-kos">,</span> <span class="pl-s1">config</span>?: <span class="pl-smi">AxiosRequestConfig</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span><span class="pl-kos">)</span>: <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi">R</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span>
  <span class="pl-s1">put</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span> <span class="pl-c1">=</span> <span class="pl-s1">never</span><span class="pl-kos">,</span> <span class="pl-smi">R</span> <span class="pl-c1">=</span> <span class="pl-smi">AxiosResponse</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;&gt;</span><span class="pl-kos">(</span><span class="pl-s1">url</span>: <span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-s1">data</span>?: <span class="pl-smi">T</span><span class="pl-kos">,</span> <span class="pl-s1">config</span>?: <span class="pl-smi">AxiosRequestConfig</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span><span class="pl-kos">)</span>: <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi">R</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span>
  <span class="pl-s1">patch</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span> <span class="pl-c1">=</span> <span class="pl-s1">never</span><span class="pl-kos">,</span> <span class="pl-smi">R</span> <span class="pl-c1">=</span> <span class="pl-smi">AxiosResponse</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;&gt;</span><span class="pl-kos">(</span><span class="pl-s1">url</span>: <span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-s1">data</span>?: <span class="pl-smi">T</span><span class="pl-kos">,</span> <span class="pl-s1">config</span>?: <span class="pl-smi">AxiosRequestConfig</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span><span class="pl-kos">)</span>: <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi">R</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">breaking every usage of the method, when using generics, e.g.:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type RequestData = {
  input: string;
};

type ResponseData = {
  value: string;
};

async function test(): Promise&lt;void&gt; {
  const requestData: RequestData = { input: &quot;input&quot; }
  const {data} = await axios.post&lt;ResponseData&gt;(&quot;https://some-endpoint.com/v1/endpoint&quot;, requestData);
  console.log(data.value);
}"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">RequestData</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-c1">input</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-k">type</span> <span class="pl-smi">ResponseData</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-c1">value</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi"><span class="pl-k">void</span></span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-s1">requestData</span>: <span class="pl-smi">RequestData</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">input</span>: <span class="pl-s">"input"</span> <span class="pl-kos">}</span>
  <span class="pl-k">const</span> <span class="pl-kos">{</span>data<span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">axios</span><span class="pl-kos">.</span><span class="pl-c1">post</span><span class="pl-kos">&lt;</span><span class="pl-smi">ResponseData</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-s">"https://some-endpoint.com/v1/endpoint"</span><span class="pl-kos">,</span> <span class="pl-s1">requestData</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">data</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">The new generics will now cause compile errors, since <code class="notranslate">RequestData</code> and <code class="notranslate">ResponseData</code> are not the same type.</p>
<p dir="auto">The following workaround helps:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="async function test(): Promise&lt;void&gt; {
  const requestData: RequestData = { input: &quot;input&quot; }
  const {data} = await axios.post&lt;RequestData, AxiosReponse&lt;ResponseData&gt;&gt;(&quot;https://some-endpoint.com/v1/endpoint&quot;, requestData);
  console.log(data.value);
}"><pre class="notranslate"><span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi"><span class="pl-k">void</span></span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-s1">requestData</span>: <span class="pl-smi">RequestData</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">input</span>: <span class="pl-s">"input"</span> <span class="pl-kos">}</span>
  <span class="pl-k">const</span> <span class="pl-kos">{</span>data<span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">axios</span><span class="pl-kos">.</span><span class="pl-c1">post</span><span class="pl-kos">&lt;</span><span class="pl-smi">RequestData</span><span class="pl-kos">,</span> <span class="pl-smi">AxiosReponse</span><span class="pl-kos">&lt;</span><span class="pl-smi">ResponseData</span><span class="pl-kos">&gt;</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-s">"https://some-endpoint.com/v1/endpoint"</span><span class="pl-kos">,</span> <span class="pl-s1">requestData</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">data</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">These changes seem arbitrary, and possibly done by mistake, as it is very unlikely, that a Post-Request has <strong>exactly</strong> the same type for its payload, as it has for its response.</p>
<p dir="auto">when doing react.js project with isomorphic this message will appear when using axios on the server side.</p>