Php 414 URI太长

Php 414 URI太长,php,post,Php,Post,我明白我为什么会犯这个错误。但我有一个严重的问题,因为我似乎无法正确地克服它 我正在使用一个名为Zoho的公司的API作为他们的招聘系统。我正在使用一个API方法来更新记录以上载文件 最初,我添加了包含其余数据的文件,但我想将其拆分,看看它是否解决了我的错误,但它没有。我的请求URI太长了 $filecontent = file_get_contents($filepath); $encodedFile = base64_encode($filecontent); $file_data =

我明白我为什么会犯这个错误。但我有一个严重的问题,因为我似乎无法正确地克服它

我正在使用一个名为Zoho的公司的API作为他们的招聘系统。我正在使用一个API方法来更新记录以上载文件

最初,我添加了包含其余数据的文件,但我想将其拆分,看看它是否解决了我的错误,但它没有。我的请求URI太长了

$filecontent = file_get_contents($filepath);
$encodedFile = base64_encode($filecontent);

$file_data =
      "<Candidates>
        <row no='1'>
          <FL val='Vedhæft CV / Attach CV'>" . $encodedFile . "</FL>
          <FL val='Vedhæft CV / Attach CV_filename'>" . $filename . "</FL>
        </row>
      </Candidates>
      ";

$encoded_file_data = urlencode($file_data);
      $file_url = 'https://recruit.zoho.com/recruit/private/xml/Candidates/updateRecords?authtoken=xxxx&scope=recruitapi&version=2&id=xxxx&xmlData=' . $encoded_file_data;
      echo strlen($file_url);
      $file_request = new WP_Http;
      $file_add_result = $file_request->request($file_url, array('method' => 'POST', 'body' => $encoded_file_data));
$filecontent=file\u get\u contents($filepath);
$encodedFile=base64_encode($filecontent);
$file\u数据=
"
" . $编码文件。"
" . $文件名。"
";
$encoded_file_data=urlencode($file_data);
$file\u url='1https://recruit.zoho.com/recruit/private/xml/Candidates/updateRecords?authtoken=xxxx&scope=recruitapi&version=2&id=xxxx&xmlData=' . $编码文件数据;
echo strlen($file\u url);
$file\u request=new WP\u Http;
$file\u add\u result=$file\u request->request($file\u url,数组('method'=>'POST','body'=>$encoded\u file\u data));
当我得到URI的长度时,它显示为61614。。。这只是一个示例文件,它可能更大。在我看来,我被迫以这种方式发送数据。我能把它改短些吗?我似乎在这上面找不到任何东西


我能通过它的唯一方法是拥有一个非常短的文件,但这不是一个真正的解决方案。

get有一个限制,不要认为post有作用。在最后一行代码中,我将方法指定为post。它仍然在URI中,放在post请求的主体中。您能详细说明吗?在我看来,我将“body”指定为$encoded\u file\u数据。似乎我误解了什么。您将
$encoded\u file\u data
放在
$file\u url
中。难怪URI太长了。。