Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/162.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
c++;curl返回413请求实体太大,但是post大小远小于max size 我注意到我的一些帖子没有提交,所以我看到了C++中卷曲的输出,它给出了 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>413 Request Entity Too Large</title> </head><body> <h1>Request Entity Too Large</h1> The requested resource<br />/receiver.php<br /> does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit. </body></html>_Php_C++_Curl - Fatal编程技术网

c++;curl返回413请求实体太大,但是post大小远小于max size 我注意到我的一些帖子没有提交,所以我看到了C++中卷曲的输出,它给出了 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>413 Request Entity Too Large</title> </head><body> <h1>Request Entity Too Large</h1> The requested resource<br />/receiver.php<br /> does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit. </body></html>

c++;curl返回413请求实体太大,但是post大小远小于max size 我注意到我的一些帖子没有提交,所以我看到了C++中卷曲的输出,它给出了 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>413 Request Entity Too Large</title> </head><body> <h1>Request Entity Too Large</h1> The requested resource<br />/receiver.php<br /> does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit. </body></html>,php,c++,curl,Php,C++,Curl,我得到了:2000万 然后得到从C++代码发送的帖子的大小: void send_request(string url, string field,string data) { string post_req = field + "=" + data; CURL *curl = curl_easy_init(); curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_POSTFIELDS,

我得到了:2000万

然后得到从C++代码发送的帖子的大小:

void send_request(string url, string field,string data) {
string post_req = field + "=" + data;
CURL *curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, post_req.c_str());
cout << "post size : " << post_req.size() << endl;
curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
void发送请求(字符串url、字符串字段、字符串数据){
字符串post_req=字段+“=”+数据;
CURL*CURL=CURL_easy_init();
curl_easy_setopt(curl,CURLOPT_URL,URL.c_str());
curl_easy_setopt(curl,CURLOPT_POSTFIELDS,post_req.c_str());

问题不在C++中,也不在PHP中。 PHP前面有一些服务器(对于unix风格的服务器,通常是
nginx
apache
,对于windows服务器,通常是microsoft的
IIS
,尽管也存在其他服务器),问题几乎肯定是该服务器中的一个配置选项

不太常见的情况是,您的服务器也可能有防火墙生成响应,但更可能是一些服务器软件,如上所述


也是无关的,但是C++代码中有一个bug:数据和字段都应该是URL编码的,显然不是.< /P>为什么是下行投票?你使用哪一个Web服务器?它的请求大小限制是什么?你的PHP代码在哪里?我们需要一个我在PHP方面打印PasyMax大小的值,它给了我20M,我的PHP是一个免费的AdvdStayHo空间。sting.我搜索了他们的请求大小限制,但没有找到任何东西,我可能会联系支持人员,因为php结果可能错误

post_max_size
是php可以接受的最大post请求大小,在你的应用程序和php之间至少会有一个web服务器,如果没有更多的话,它会有自己的规则。我现在就提交一张罚单等待他们的回应,我认为你是对的,我必须买一个付费帐户
void send_request(string url, string field,string data) {
string post_req = field + "=" + data;
CURL *curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, post_req.c_str());
cout << "post size : " << post_req.size() << endl;
curl_easy_perform(curl);
curl_easy_cleanup(curl);
}