Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7933259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:16:32+00:00 2026-06-03T21:16:32+00:00

I am sending a HTTP request via cURL and I keep getting this 413

  • 0

I am sending a HTTP request via cURL and I keep getting this 413 error. The file that I am trying to send is on 21kb and I have checked my php.ini file. Can someone tell me what is wrong?

Here is my code that is directly effecting the HTTP request:

    <?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Class for creating test cases to be sent 
 * into TestRail
 * @author Banderson
 */
class testCase {

    /*Function to get the data for each individual test case*/
    function getTestCase($row, $highestColIndex, $PHPobjWorksheet){

            echo "<br />";
            for($col=0;$col<=$highestColIndex;++$col){
                $v=$PHPobjWorksheet->getCellByColumnAndRow($col,$row)->getValue();
                $cellValue[]=$v;



        }

    return $cellValue;

    }


    /*Function to set the data for each individual test case*/
    function setTestCase($cellValue){
                $case[]=array();
                $case['title'] = $cellValue[0];
                echo $case['title']. "<- Title"."<br/>";
                $case['type'] = $cellValue[1];
                echo $case['type']. "<- Type"."<br/>";
                $case['priority'] = $cellValue[2];
                echo $case['priority']. "<- Priority"."<br/>";


                /*$case['estimate'] = $cellValue[3];
                echo $case['estimate']. "<- Estimate"."<br/>";
                $case['milestone'] = $cellValue[4];
                echo $case['milestone']. "<- MileStone"."<br/>";
                $case['refs'] = $cellValue[5];
                echo $case['refs']. "<- Custom Refs"."<br/>";
                $case['precon'] = $cellValue[6];
                echo $case['precon']. "<- Custom Precondition"."<br/>";
                $case['steps'] = $cellValue[7];
                echo $case['steps']. "<- Custom Steps"."<br/>";
                $case['expectedresults'] = $cellValue[8];
                echo  $case['expectedresults']. "<- Expected Results"."<br/>";
                $case['testSuite'] = $cellValue[9];
                echo $case['testSuite']. "<- TestSuite"."<br/>";*/


                $caseData=array(

                    'Title'=> $case['title'],
                    'Type'=> $case['type'],
                    'Priority'=> $case['priority'],
                    'key'=> "246810",


                );

                return $caseData;


    }

    function sendTestCase($caseArgs){
        try{
            $ch = curl_init();
            //$sendData = http_build_query($caseArgs);

            $header=array();
            $header[]= "Accept: application/json";

            $header[]= "Host: localhost";
            $header[]= "Title=newTitle";
            $header[]= "key=2467810";



            curl_setopt($ch, CURLOPT_URL, 'http://localhost:8888/testrail/index.php?/miniapi/add_case/2');  
            curl_setopt($ch, CURLOPT_POSTFIELDS, $header);
            curl_setopt($ch, CURLOPT_POST, 1);



            curl_exec($ch);
            curl_close($ch);
        }
        catch (HttpException $ex){
            echo $ex."<-Exception";
 }


    }

}

?>

I would have included my php.ini file, but that is too big. I’m open to any advice! Thank you in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:16:35+00:00Added an answer on June 3, 2026 at 9:16 pm

    413 is ‘request entity is too large’. Any reason you’re trying to stuff HTTP headers into the POSTFIELDS section? If this service is not expecting any post fields (eg. body should be 0 bytes), then using POSTFIELDs to send your “headers” will definitely set this off. For headeres, you should be using CURLOPT_HTTPHEADER instead

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am sending password text to the http service request object.like <request><password>pass.text</password></request> now this
I am sending a simple GET request via the API http://myhudson/job/jobname/lastBuild/delete however, hudson seems
I am trying to pass a string via HTTP request which has one of
I have application that received data via HTTP POST requests. I'm trying to use
I am sending HTTP GET request and receiving data here: ssize_t numBytes = recvfrom(sock,
I got some sample code from the net here: http://www.javadb.com/sending-a-post-request-with-parameters-from-a-java-class That works fine. It
I have a PHP script that is sending a series of http requests to
I have a test script to receive an xml file via http post and
So I have a Sinatra app that receives an XML via a HTTP POST
I am working with a 3rd party that wants to send info via url

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.