我收到此错误:
<h2>Incomplete response received from application</h2>
当正文非常大>1245
字符
例如,如果我这样做请求
curl -X POST \
-d '{"xxxxxxxxxxxxxxxxxxxxxxxx":{"xxxxxxxxxxxx":xxxx,"xxxxxxxxxxxx":["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]},"xxxxxxxxxxxxxxxxxx":["xxxxx xxx","xxxxx xxxxxxxxxxxxxxx","xxxxx xxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxxxxxxxx","xxxxx xxxxxxxxx","xxxxx xxxxxxxxxxxxx","xxxxx xxxxxxxxxxxx","xxxxx xxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxxxxx","xxxxx xxxxxxxx","xxxxx xxxxxxxxxxxxxxx","xxxxx xxxxxxxxx","xxxxx xxxxxxxxxxxxx","xxxxx xxxxxx","xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxxx","xxxxx xx","xxxxx xxxxxxxxx","xxxxx xxxxxxxx","xxxxx xxxxxxxxx","xxxxx xxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxx","xxxxx xxxxxxxxxx","xxxxx xxxxxxxxxxxx","xxxxxx xxxxxxxxx xx","xxxxxx xxxxxxx xx","xxxxxx xxxxxxxx","xxxxxx xx","xxxxxx xx xxxx","xxxxxx xxxxxxxxx xx","xxxxxx xxxxxxxxx xx xxxx","xxxxxx xxxxxxxxx xx","xxxxxx xxxxx","xxxxxx xxxxxx xx","xxxxxx xxxx","xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","xx"]}' \
http://miapplication/action.csv
效果很好..但如果我在身体上添加一个角色:
curl -X POST \
-d '{"xxxxxxxxxxxxxxxxxxxxxxxx":{"xxxxxxxxxxxx":xxxx,"xxxxxxxxxxxx":["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]},"xxxxxxxxxxxxxxxxxx":["xxxxx xxx","xxxxx xxxxxxxxxxxxxxx","xxxxx xxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxxxxxxxx","xxxxx xxxxxxxxx","xxxxx xxxxxxxxxxxxx","xxxxx xxxxxxxxxxxx","xxxxx xxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxxxxx","xxxxx xxxxxxxx","xxxxx xxxxxxxxxxxxxxx","xxxxx xxxxxxxxx","xxxxx xxxxxxxxxxxxx","xxxxx xxxxxx","xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxxx","xxxxx xx","xxxxx xxxxxxxxx","xxxxx xxxxxxxx","xxxxx xxxxxxxxx","xxxxx xxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxx","xxxxx xxxxxxxxxx","xxxxx xxxxxxxxxxxx","xxxxxx xxxxxxxxx xx","xxxxxx xxxxxxx xx","xxxxxx xxxxxxxx","xxxxxx xx","xxxxxx xx xxxx","xxxxxx xxxxxxxxx xx","xxxxxx xxxxxxxxx xx xxxx","xxxxxx xxxxxxxxx xx","xxxxxx xxxxx","xxxxxx xxxxxx xx","xxxxxx xxxx","xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","xxx"]}' \
http://miapplication/action.csv
失败并出现上述错误。
我在SO中看到了几个关于此错误的线程,但所有这些线程都与secrets.yml
文件的设置有关。我在我的应用程序中正确设置了此文件。同样在我的情况下,错误只发生在它们的体型超过特定尺寸时。
答案 0 :(得分:0)
经过大量尝试错误后,我正确指定Content-Type
时问题已解决。
curl -X POST \
-H "Content-Type: application/json"
-d '{"xxxxxxxxxxxxxxxxxxxxxxxx":{"xxxxxxxxxxxx":xxxx,"xxxxxxxxxxxx":["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]},"xxxxxxxxxxxxxxxxxx":["xxxxx xxx","xxxxx xxxxxxxxxxxxxxx","xxxxx xxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxxxxxxxx","xxxxx xxxxxxxxx","xxxxx xxxxxxxxxxxxx","xxxxx xxxxxxxxxxxx","xxxxx xxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxxxxx","xxxxx xxxxxxxx","xxxxx xxxxxxxxxxxxxxx","xxxxx xxxxxxxxx","xxxxx xxxxxxxxxxxxx","xxxxx xxxxxx","xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxxx","xxxxx xx","xxxxx xxxxxxxxx","xxxxx xxxxxxxx","xxxxx xxxxxxxxx","xxxxx xxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxx","xxxxx xxxxxxxxxxxxxxxxx","xxxxx xxxxxxxxxxx","xxxxx xxxxxxxxxx","xxxxx xxxxxxxxxxxx","xxxxxx xxxxxxxxx xx","xxxxxx xxxxxxx xx","xxxxxx xxxxxxxx","xxxxxx xx","xxxxxx xx xxxx","xxxxxx xxxxxxxxx xx","xxxxxx xxxxxxxxx xx xxxx","xxxxxx xxxxxxxxx xx","xxxxxx xxxxx","xxxxxx xxxxxx xx","xxxxxx xxxx","xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","xxx"]}' \
http://miapplication/action.csv