HTTP Error: 413 Request Entity Too Large的解决
昨天在使用PHP的CURL调用另一个项目的API:A时,出现了HTTP Error: 413 Request Entity Too Large的错误。而调用另一个API:B则没有这个错误。
A的API没有请求参数。而B有个请求参数。而此类在linux上没有问题,在window上有问题。
首先考虑是否apache配置问题。检查了httpd.conf和php.int,,post_max_size,memory_limit,upload_file_size等,都不可能超过这些上限值。
之后再httpd.conf文件加上
LimitRequestBody 0
LimitRequestLine 0
LimitRequestFieldSize 0
LimitxmlRequestBody 0
ErrorDocument 413 "Sorry,Error Page"
也都无法解决问题。
然后就检查代码,看看两个API的调用有什么区别。区别有2点,返回数据产度不同。有无请求参数。
而提示是显示request entity too large,应该和返回无关。那我就手动修改了请求头的Content-Length:0。第一个无参数的返回正确了。而第二个由于请求头的长度和实际长度不一致(等于没请求参数),导致请求失败。
因此,确定是Content-Length的问题。通过strlen(data);确定后设置Content-Length后,解决此问题。
今天又出现了个错误:
Request-URI too large
The requested URL's length exceeds the capacity limit for the server
因为之前在httpd.conf中设置了LimitRequestLine 0
我以为0是不限制的意思。看来理解错了。删掉改行或者设置为LimitRequestLine 1000000000就OK了。
HTTP Error: 413 Request Entity Too Large的解决的更多相关文章
- 解决Gitlab的The remote end hung up unexpectedly错误,解决RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large问题
解决Gitlab的The remote end hung up unexpectedly错误 解决RPC failed; HTTP 413 curl 22 The requested URL retu ...
- (原)使用TortoiseGit提交代码push的时候报错:HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
今天我想rk的sdk包里面的一些东西提交到我的git服务器上,结果,总是报错,折腾了一下午,结果才解决. 首先看看我提交代码的时候,报错的信息: git.exe push --progress &qu ...
- 解决RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large问题
使用SourceTree客户端,向远程仓库推送时:RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request ...
- 使用git提交时报错:error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
Delta compression using up to 4 threads.Compressing objects: 100% (2364/2364), done.Writing objects: ...
- 【Git】error: RPC failed; HTTP 413 curl 22 The requested URL returned error:413 Request Entity Too Large
error: RPC failed; HTTP 413 curl 22 The requested URL returned error:413 Request Entity Too Large fa ...
- Nginx出现“413 Request Entity Too Large”错误解决方法
Nginx出现“413 Request Entity Too Large”错误解决方法 2011-03-25 13:49:55| 分类: 默认分类 | 标签:413 request entit ...
- Nginx 出现413 Request Entity Too Large得解决方法
Nginx 出现413 Request Entity Too Large得解决方法 默认情况下使用nginx反向代理上传超过2MB的文件,会报错413 Request Entity Too Large ...
- Nginx出现413 Request Entity Too Large错误解决方法
Nginx出现的413 Request Entity Too Large错误,这个错误一般在上传文件的时候出现,打开nginx主配置文件nginx.conf,找到http{}段,添加 解决方法就是 打 ...
- Nginx配置,413 Request Entity Too Large错误解决
今天有同事找我,说图片上传之后,不知道去哪里了.分析了一下问题,找到原因之后做了处理,这里简要记录一下. 问题原因: 1.首先后台log并无错误信息: 2.捡查了一下浏览器,发现network中有报错 ...
随机推荐
- c++ 判断list是否为空(empty)
#include <list> #include <iostream> using namespace std; int main() { list<int> nu ...
- Android 引用资源
比如在 strings.xml 中找到的 Hello world!字符串,我们有两种方式可以引用它: 1. 在代码中通过 R.string.hello_world 可以获得该字符串的引用: 2. 在 ...
- RxJava和RxAndroid
现在RxJava和RxAndroid越来越火爆,自己在业余时间也学习了一下,感觉确实很好用,之前 为了完成页面刷新,数据请求,组件信息传递的时候,要使用handler,真的是逻辑思路很强,稍微不注意, ...
- torchnet+VGG16计算patch之间相似度
torchnet+VGG16计算patch之间相似度 torch VGG16 similarity 本来打算使用VGG实现siamese CNN的,但是没想明白怎么使用torchnet对模型进行微调. ...
- 个人知识管理系统Version1.0开发记录(11)
(1)匹配单个属性的关键字:(2)匹配单个对象的关键字:(3)匹配对象集合的关键字:(4)基于事件驱动的:(5)实时搜索,参考win7的搜索功能. 1.备份,java代码,数据库数据. 2.oracl ...
- 创建对象并生成结果的3个步骤-Chapter 3 P38
必须完成3个步骤才能创建对象并生成结果: 1 创建对象 namespace LanguageFeatures { public class Product { public int Product ...
- 重构 demo篇
本文背景为学习重构一书中的一些信息的记录. 该篇以一个影片租赁为背景.通过一层层的重构,最终实现相对来说比较完美的代码. 文中经典语句摘要: “如果它没有坏,就不要动它 .” 用来形容我们工作中一些比 ...
- Alpha发布
作业链接[https://edu.cnblogs.com/campus/nenu/2018fall/homework/2283] 视频展示 链接[https://v.youku.com/v_show/ ...
- New Concept English Two 17 43
$课文41 你把那个叫帽子吗? 422. 'Do you call that a hat?' I said to my wife. “你把那个叫帽子吗?”我对妻子说. 423. 'You needn ...
- React Native自适应设备宽度解决方案
px:设备实际像素单位 dp/pt:逻辑像素单位(IOS的尺寸单位为pt,Android的尺寸单位为dp) 在设计和开发过程中,应该尽量使用逻辑像素尺寸来思考界面. UI 给默认 640 的图,采用 ...