<h4 dir="auto">Summary</h4>
<p dir="auto">When submitting a <code class="notranslate">POST</code> request of relatively small size,</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import * as qs from &quot;querystring&quot;;
import axios from &quot;axios&quot;;

const requestConfig = {
    url : myUrl,
    method : &quot;POST&quot;,
    headers : {
        &quot;Content-Type&quot; : &quot;application/x-www-form-urlencoded&quot;,
    },
    data : qs.stringify({ test : &quot;data&quot; });
};
const response = await axios.request(requestConfig);
console.log(
    requestConfig.method,
    requestConfig.url,
    response.status,
    response.statusText,
    typeof response.data
);
console.log(response.request._header);
//Output: &quot;POST&quot;, myUrl, 200, &quot;OK&quot;, &quot;string&quot;
//Output: &quot;POST myUrl HTTP/1.1/*snip*/"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">qs</span> <span class="pl-k">from</span> <span class="pl-s">"querystring"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-s1">axios</span> <span class="pl-k">from</span> <span class="pl-s">"axios"</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-s1">requestConfig</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
    <span class="pl-c1">url</span> : <span class="pl-s1">myUrl</span><span class="pl-kos">,</span>
    <span class="pl-c1">method</span> : <span class="pl-s">"POST"</span><span class="pl-kos">,</span>
    <span class="pl-c1">headers</span> : <span class="pl-kos">{</span>
        <span class="pl-s">"Content-Type"</span> : <span class="pl-s">"application/x-www-form-urlencoded"</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-c1">data</span> : <span class="pl-s1">qs</span><span class="pl-kos">.</span><span class="pl-en">stringify</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">test</span> : <span class="pl-s">"data"</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">response</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-en">request</span><span class="pl-kos">(</span><span class="pl-s1">requestConfig</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">requestConfig</span><span class="pl-kos">.</span><span class="pl-c1">method</span><span class="pl-kos">,</span>
    <span class="pl-s1">requestConfig</span><span class="pl-kos">.</span><span class="pl-c1">url</span><span class="pl-kos">,</span>
    <span class="pl-s1">response</span><span class="pl-kos">.</span><span class="pl-c1">status</span><span class="pl-kos">,</span>
    <span class="pl-s1">response</span><span class="pl-kos">.</span><span class="pl-c1">statusText</span><span class="pl-kos">,</span>
    <span class="pl-k">typeof</span> <span class="pl-s1">response</span><span class="pl-kos">.</span><span class="pl-c1">data</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">response</span><span class="pl-kos">.</span><span class="pl-c1">request</span><span class="pl-kos">.</span><span class="pl-c1">_header</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">//Output: "POST", myUrl, 200, "OK", "string"</span>
<span class="pl-c">//Output: "POST myUrl HTTP/1.1/*snip*/</span></pre></div>
<p dir="auto">However, when I <code class="notranslate">stringify()</code> a larger object, giving a string of about 55k characters,</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//Output: &quot;POST&quot;, myUrl, 200, &quot;OK&quot;, &quot;string&quot;
//Output:  &quot;GET / HTTP/1.1 /*snip*/"><pre class="notranslate"><span class="pl-c">//Output: "POST", myUrl, 200, "OK", "string"</span>
<span class="pl-c">//Output:  "GET / HTTP/1.1 /*snip*/</span></pre></div>
<p dir="auto">I expected <code class="notranslate">POST myUrl</code> but got <code class="notranslate">GET /</code>.</p>
<p dir="auto">So, while my config says "POST" and gives a URL that is not the root, it seems like axios is doing its own thing.</p>
<h4 dir="auto">Context</h4>
<ul dir="auto">
<li>axios version: 0.16 and 0.18.0</li>
<li>Environment: node v6.11.0, ts-node v3.3.0, TS v2.7.2, Ubuntu 16.04.2</li>
</ul>
<hr>
<p dir="auto">I tried <code class="notranslate">fetch()</code> on my browser and the request works fine.</p>
<p dir="auto">I also tried the <code class="notranslate">request</code> npm package and it worked fine. For now, I'll use <code class="notranslate">request</code> for <code class="notranslate">POST</code>-ing "large" amounts of data. It just seems weird that axios works most of the time, except for "large" chunks of data.</p>
<p dir="auto">android 4.4.4 系统上，我用axios发起请求，后台返回json数据过大的时候，response 为null，后面改用fetch 使用ok，使用环境react native 0.55版本</p>
<ul dir="auto">
<li>axios version: <em>e.g.: v0.18.0</em></li>
</ul>