title: Request entity too large when passing POST data in curl
body: <p>I have a fastcgi++ service. It takes 4 parameters through POST because one of them is a password. My sample input is 61 characters. This is how I am calling my service:</p>
  
  <pre><code>curl --data 'name=test&amp;address=abc&amp;phoneNumber=0987654321&amp;password=test123' http://localhost/cgi-bin/add-user.fcg
  </code></pre>
  
  <p>I get this error: <strong>413 Request Entity too large</strong>. Based on my research I found that it means apache was expecting a smaller body than it got. So, I added <code>LimitRequestBody 0</code> to httpd.conf (I am not in production environment). But apache still complains that the request entity is too large.</p>
  
  <p>I added -v to curl and this is the output:</p>
  
  <pre><code>*   Trying ::1...
  * TCP_NODELAY set
  * Connected to localhost (::1) port 80 (#0)
  &gt; POST /cgi-bin/add-user.fcg HTTP/1.1
  &gt; Host: localhost
  &gt; User-Agent: curl/7.61.1
  &gt; Accept: */*
  &gt; Content-Length: 60
  &gt; Content-Type: application/x-www-form-urlencoded
  &gt; 
  * upload completely sent off: 60 out of 60 bytes
  &lt; HTTP/1.1 413 Request Entity Too Large
  &lt; Date: Sun, 24 Mar 2019 03:48:09 GMT
  &lt; Server: Apache/2.4.38 (Fedora) mod_fcgid/2.3.9
  &lt; Connection: close
  &lt; Transfer-Encoding: chunked
  &lt; Content-Type: text/html; charset=utf-8
  &lt; 
  * Closing connection 0
  &lt;!DOCTYPE html&gt;&lt;html lang='en'&gt;&lt;head&gt;&lt;title&gt;413 Request Entity Too Large&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;h1&gt;413 Request Entity Too Large&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>This is my httpd.conf:</p>
  
  <pre><code>ServerRoot "/etc/httpd"
  
  Listen 80
  
  Include conf.modules.d/*.conf
  
  User apache
  Group apache
  
  ServerAdmin root@localhost
  
  &lt;Directory /&gt;
      AllowOverride none
      Require all denied
  &lt;/Directory&gt;
  
  DocumentRoot "/var/www/html"
  
  &lt;Directory "/var/www"&gt;
      AllowOverride None
      # Allow open access:
      Require all granted
  &lt;/Directory&gt;
  
  &lt;Directory "/var/www/html"&gt;
      Options Indexes FollowSymLinks
  
      AllowOverride None
  
      Require all granted
  &lt;/Directory&gt;
  
  &lt;IfModule dir_module&gt;
      DirectoryIndex index.html
  &lt;/IfModule&gt;
  
  &lt;Files ".ht*"&gt;
      Require all denied
  &lt;/Files&gt;
  
  ErrorLog "logs/error_log"
  
  LogLevel warn
  
  &lt;IfModule log_config_module&gt;
      LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
      LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
  
      &lt;IfModule logio_module&gt;
        LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
      &lt;/IfModule&gt;
  
  
      CustomLog "logs/access_log" combined
  &lt;/IfModule&gt;
  
  &lt;IfModule alias_module&gt;
      ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
  &lt;/IfModule&gt;
  
  &lt;Directory "/var/www/cgi-bin"&gt;
      AllowOverride None
      Options +ExecCGI
      Require all granted
      SetHandler fcgid-script
  &lt;/Directory&gt;
  
  &lt;IfModule mime_module&gt;
      TypesConfig /etc/mime.types
  
      AddType application/x-compress .Z
      AddType application/x-gzip .gz .tgz
  
      AddType text/html .shtml
      AddOutputFilter INCLUDES .shtml
  &lt;/IfModule&gt;
  
  AddDefaultCharset UTF-8
  
  &lt;IfModule mime_magic_module&gt;
      MIMEMagicFile conf/magic
  &lt;/IfModule&gt;
  
  EnableSendfile on
  
  IncludeOptional conf.d/*.conf
  
  #I added the line below
  LimitRequestBody 0 
  </code></pre>
  
  <p>This it the fcgid.conf:</p>
  
  <pre><code>AddHandler fcgid-script fcg fcgi fpl
  
  Sane place to put sockets and shared memory file
  FcgidIPCDir /run/mod_fcgid
  FcgidProcessTableFile /run/mod_fcgid/fcgid_shm
  </code></pre>