<p dir="auto">The <code class="notranslate">insecureHTTPParser</code> property that was added in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="606882134" data-permission-text="Title is private" data-url="https://github.com/axios/axios/issues/2930" data-hovercard-type="pull_request" data-hovercard-url="/axios/axios/pull/2930/hovercard" href="https://github.com/axios/axios/pull/2930">#2930</a> never got added to the TypeScript typings.</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/fabiel-leon/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/fabiel-leon">@fabiel-leon</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jasonsaayman/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jasonsaayman">@jasonsaayman</a> Please be aware of this for future PRs 😃.</p>
<h3 dir="auto">Describe the issue</h3>
<p dir="auto">Currently the AxiosResponse interface may have two parameters: T and D which by default are set as any.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export interface AxiosResponse&lt;T = any, D = any&gt; {
  data: T;
  status: number;
  statusText: string;
  headers: RawAxiosResponseHeaders | AxiosResponseHeaders;
  config: InternalAxiosRequestConfig&lt;D&gt;;
  request?: any;
}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">interface</span> <span class="pl-smi">AxiosResponse</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span> <span class="pl-c1">=</span> <span class="pl-smi">any</span><span class="pl-kos">,</span> <span class="pl-smi">D</span> <span class="pl-c1">=</span> <span class="pl-smi">any</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-c1">data</span>: <span class="pl-smi">T</span><span class="pl-kos">;</span>
  <span class="pl-c1">status</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
  <span class="pl-c1">statusText</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
  <span class="pl-c1">headers</span>: <span class="pl-smi">RawAxiosResponseHeaders</span> <span class="pl-c1">|</span> <span class="pl-smi">AxiosResponseHeaders</span><span class="pl-kos">;</span>
  <span class="pl-c1">config</span>: <span class="pl-smi">InternalAxiosRequestConfig</span><span class="pl-kos">&lt;</span><span class="pl-smi">D</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span>
  <span class="pl-c1">request</span>?: <span class="pl-smi">any</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">As we are able to see from just this snippet. The <code class="notranslate">data</code> will receive the T type, and <code class="notranslate">config</code> will receive the <code class="notranslate">InternalAxiosRequestConfig&lt;D&gt;</code> type, following this <code class="notranslate">InternalAxiosRequestConfig</code> interface:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export interface InternalAxiosRequestConfig&lt;D = any&gt; extends AxiosRequestConfig&lt;D&gt; {
  ...
}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">interface</span> <span class="pl-smi">InternalAxiosRequestConfig</span><span class="pl-c1">&lt;</span><span class="pl-smi">D</span> <span class="pl-c1">=</span> <span class="pl-smi">any</span><span class="pl-c1">&gt;</span> <span class="pl-k">extends</span> <span class="pl-smi">AxiosRequestConfig</span><span class="pl-kos">&lt;</span><span class="pl-smi">D</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span>
  ...
<span class="pl-kos">}</span></pre></div>
<p dir="auto">We head then to <code class="notranslate">AxiosRequestConfig</code> that receives the D type:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export interface AxiosRequestConfig&lt;D = any&gt; {
  url?: string;
  method?: Method | string;
  baseURL?: string;
  transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
  transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
  headers?: (RawAxiosRequestHeaders &amp; MethodsHeaders) | AxiosHeaders;
  params?: any;
  paramsSerializer?: ParamsSerializerOptions;
  data?: D;
  timeout?: Milliseconds;
  timeoutErrorMessage?: string;
  withCredentials?: boolean;
  adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
  auth?: AxiosBasicCredentials;
  responseType?: ResponseType;
  responseEncoding?: responseEncoding | string;
  xsrfCookieName?: string;
  xsrfHeaderName?: string;
  onUploadProgress?: (progressEvent: AxiosProgressEvent) =&gt; void;
  onDownloadProgress?: (progressEvent: AxiosProgressEvent) =&gt; void;
  maxContentLength?: number;
  validateStatus?: ((status: number) =&gt; boolean) | null;
  maxBodyLength?: number;
  maxRedirects?: number;
  maxRate?: number | [MaxUploadRate, MaxDownloadRate];
  beforeRedirect?: (options: Record&lt;string, any&gt;, responseDetails: {headers: Record&lt;string, string&gt;}) =&gt; void;
  socketPath?: string | null;
  httpAgent?: any;
  httpsAgent?: any;
  proxy?: AxiosProxyConfig | false;
  cancelToken?: CancelToken;
  decompress?: boolean;
  transitional?: TransitionalOptions;
  signal?: GenericAbortSignal;
  insecureHTTPParser?: boolean;
  env?: {
    FormData?: new (...args: any[]) =&gt; object;
  };
  formSerializer?: FormSerializerOptions;
}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">interface</span> <span class="pl-smi">AxiosRequestConfig</span><span class="pl-c1">&lt;</span><span class="pl-smi">D</span> <span class="pl-c1">=</span> <span class="pl-smi">any</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-c1">url</span>?: <span class="pl-smi">string</span><span class="pl-kos">;</span>
  <span class="pl-c1">method</span>?: <span class="pl-smi">Method</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span><span class="pl-kos">;</span>
  <span class="pl-c1">baseURL</span>?: <span class="pl-smi">string</span><span class="pl-kos">;</span>
  <span class="pl-c1">transformRequest</span>?: <span class="pl-smi">AxiosRequestTransformer</span> <span class="pl-c1">|</span> <span class="pl-smi">AxiosRequestTransformer</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
  <span class="pl-c1">transformResponse</span>?: <span class="pl-smi">AxiosResponseTransformer</span> <span class="pl-c1">|</span> <span class="pl-smi">AxiosResponseTransformer</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
  <span class="pl-c1">headers</span>?: <span class="pl-kos">(</span><span class="pl-smi">RawAxiosRequestHeaders</span> <span class="pl-c1">&amp;</span> <span class="pl-smi">MethodsHeaders</span><span class="pl-kos">)</span> <span class="pl-c1">|</span> <span class="pl-smi">AxiosHeaders</span><span class="pl-kos">;</span>
  <span class="pl-c1">params</span>?: <span class="pl-smi">any</span><span class="pl-kos">;</span>
  <span class="pl-c1">paramsSerializer</span>?: <span class="pl-smi">ParamsSerializerOptions</span><span class="pl-kos">;</span>
  <span class="pl-c1">data</span>?: <span class="pl-smi">D</span><span class="pl-kos">;</span>
  <span class="pl-c1">timeout</span>?: <span class="pl-smi">Milliseconds</span><span class="pl-kos">;</span>
  <span class="pl-c1">timeoutErrorMessage</span>?: <span class="pl-smi">string</span><span class="pl-kos">;</span>
  <span class="pl-c1">withCredentials</span>?: <span class="pl-smi">boolean</span><span class="pl-kos">;</span>
  <span class="pl-c1">adapter</span>?: <span class="pl-smi">AxiosAdapterConfig</span> <span class="pl-c1">|</span> <span class="pl-smi">AxiosAdapterConfig</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
  <span class="pl-c1">auth</span>?: <span class="pl-smi">AxiosBasicCredentials</span><span class="pl-kos">;</span>
  <span class="pl-c1">responseType</span>?: <span class="pl-smi">ResponseType</span><span class="pl-kos">;</span>
  <span class="pl-c1">responseEncoding</span>?: <span class="pl-smi">responseEncoding</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span><span class="pl-kos">;</span>
  <span class="pl-c1">xsrfCookieName</span>?: <span class="pl-smi">string</span><span class="pl-kos">;</span>
  <span class="pl-c1">xsrfHeaderName</span>?: <span class="pl-smi">string</span><span class="pl-kos">;</span>
  <span class="pl-c1">onUploadProgress</span>?: <span class="pl-kos">(</span><span class="pl-s1">progressEvent</span>: <span class="pl-smi">AxiosProgressEvent</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi"><span class="pl-k">void</span></span><span class="pl-kos">;</span>
  <span class="pl-c1">onDownloadProgress</span>?: <span class="pl-kos">(</span><span class="pl-s1">progressEvent</span>: <span class="pl-smi">AxiosProgressEvent</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi"><span class="pl-k">void</span></span><span class="pl-kos">;</span>
  <span class="pl-c1">maxContentLength</span>?: <span class="pl-smi">number</span><span class="pl-kos">;</span>
  <span class="pl-c1">validateStatus</span>?: <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">status</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">boolean</span><span class="pl-kos">)</span> <span class="pl-c1">|</span> <span class="pl-c1">null</span><span class="pl-kos">;</span>
  <span class="pl-c1">maxBodyLength</span>?: <span class="pl-smi">number</span><span class="pl-kos">;</span>
  <span class="pl-c1">maxRedirects</span>?: <span class="pl-smi">number</span><span class="pl-kos">;</span>
  <span class="pl-c1">maxRate</span>?: <span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-kos">[</span><span class="pl-smi">MaxUploadRate</span><span class="pl-kos">,</span> <span class="pl-smi">MaxDownloadRate</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
  <span class="pl-c1">beforeRedirect</span>?: <span class="pl-kos">(</span><span class="pl-s1">options</span>: <span class="pl-smi">Record</span><span class="pl-kos">&lt;</span><span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-smi">any</span><span class="pl-kos">&gt;</span><span class="pl-kos">,</span> <span class="pl-s1">responseDetails</span>: <span class="pl-kos">{</span><span class="pl-c1">headers</span>: <span class="pl-smi">Record</span><span class="pl-kos">&lt;</span><span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-smi">string</span><span class="pl-kos">&gt;</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi"><span class="pl-k">void</span></span><span class="pl-kos">;</span>
  <span class="pl-c1">socketPath</span>?: <span class="pl-smi">string</span> <span class="pl-c1">|</span> <span class="pl-c1">null</span><span class="pl-kos">;</span>
  <span class="pl-c1">httpAgent</span>?: <span class="pl-smi">any</span><span class="pl-kos">;</span>
  <span class="pl-c1">httpsAgent</span>?: <span class="pl-smi">any</span><span class="pl-kos">;</span>
  <span class="pl-c1">proxy</span>?: <span class="pl-smi">AxiosProxyConfig</span> <span class="pl-c1">|</span> <span class="pl-c1">false</span><span class="pl-kos">;</span>
  <span class="pl-c1">cancelToken</span>?: <span class="pl-smi">CancelToken</span><span class="pl-kos">;</span>
  <span class="pl-c1">decompress</span>?: <span class="pl-smi">boolean</span><span class="pl-kos">;</span>
  <span class="pl-c1">transitional</span>?: <span class="pl-smi">TransitionalOptions</span><span class="pl-kos">;</span>
  <span class="pl-c1">signal</span>?: <span class="pl-smi">GenericAbortSignal</span><span class="pl-kos">;</span>
  <span class="pl-c1">insecureHTTPParser</span>?: <span class="pl-smi">boolean</span><span class="pl-kos">;</span>
  <span class="pl-c1">env</span>?: <span class="pl-kos">{</span>
    <span class="pl-c1">FormData</span>?: <span class="pl-k">new</span> <span class="pl-kos">(</span>...<span class="pl-s1">args</span>: <span class="pl-smi">any</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">object</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span><span class="pl-kos">;</span>
  <span class="pl-c1">formSerializer</span>?: <span class="pl-smi">FormSerializerOptions</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">That we can see it is set as the data property type...</p>
<p dir="auto">Is this intended? What should be the differences from T and D in this scope?</p>
<h3 dir="auto">Example Code</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Currently I need to type my requests as <code class="notranslate">axios.get&lt;IExample, IExample&gt;(...)</code> to not have the default any typing...<br>
If there was only one template type it would be a bit cleaner as <code class="notranslate">axios.get&lt;IExample&gt;(...)</code></p>
<h3 dir="auto">Axios Version</h3>
<p dir="auto">^1.3.0</p>
<h3 dir="auto">Adapter Version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Browser</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Browser Version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Node.js Version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">OS</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional Library Versions</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;@chakra-ui/react&quot;: &quot;^2.4.9&quot;,
    &quot;axios&quot;: &quot;^1.3.0&quot;,
    &quot;formik&quot;: &quot;^2.2.9&quot;,
    &quot;js-cookie&quot;: &quot;^3.0.1&quot;,
    &quot;react&quot;: &quot;^18.2.0&quot;,
    &quot;react-dom&quot;: &quot;^18.2.0&quot;,
    &quot;react-icons&quot;: &quot;^4.7.1&quot;,
    &quot;react-query&quot;: &quot;^3.39.3&quot;,
    &quot;react-router-dom&quot;: &quot;^6.7.0&quot;,
    &quot;yup&quot;: &quot;^0.32.11&quot;"><pre class="notranslate"><span class="pl-s"><span class="pl-pds">"</span>@chakra-ui/react<span class="pl-pds">"</span></span>: <span class="pl-s"><span class="pl-pds">"</span>^2.4.9<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>axios<span class="pl-pds">"</span></span>: <span class="pl-s"><span class="pl-pds">"</span>^1.3.0<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>formik<span class="pl-pds">"</span></span>: <span class="pl-s"><span class="pl-pds">"</span>^2.2.9<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>js-cookie<span class="pl-pds">"</span></span>: <span class="pl-s"><span class="pl-pds">"</span>^3.0.1<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>react<span class="pl-pds">"</span></span>: <span class="pl-s"><span class="pl-pds">"</span>^18.2.0<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>react-dom<span class="pl-pds">"</span></span>: <span class="pl-s"><span class="pl-pds">"</span>^18.2.0<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>react-icons<span class="pl-pds">"</span></span>: <span class="pl-s"><span class="pl-pds">"</span>^4.7.1<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>react-query<span class="pl-pds">"</span></span>: <span class="pl-s"><span class="pl-pds">"</span>^3.39.3<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>react-router-dom<span class="pl-pds">"</span></span>: <span class="pl-s"><span class="pl-pds">"</span>^6.7.0<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>yup<span class="pl-pds">"</span></span>: <span class="pl-s"><span class="pl-pds">"</span>^0.32.11<span class="pl-pds">"</span></span></pre></div>
<h3 dir="auto">Additional context/Screenshots</h3>
<p dir="auto"><em>No response</em></p>