英文:
KrakenD returns a 500 when the body of the backend endpoint doesnt have any data
问题
我正在使用KrakenD调用Salesforce的一个端点/services/data/v56/jobs/ingest/{{_jobId}}/batches
。
这个后端端点
在响应体中不返回任何数据,结果调用失败并返回500错误。从日志中可以看到:
[00] [KRAKEND] 2023/01/27 - 23:39:45.615 ▶ ERROR [ENDPOINT: /ingest/:jobId/batches] EOF
我该如何解决这个错误?我如何告诉KrakenD预期空的响应体?我没有使用任何自定义插件。
英文:
I am using KrakenD to make a call to a Salesforce endpoint
/services/data/v56/jobs/ingest/{{_jobId}}/batches
This backend endpoint
doesn't return any data in the response body and as a result the call fails with a 500. From the logs -
[00] [KRAKEND] 2023/01/27 - 23:39:45.615 ▶ ERROR [ENDPOINT: /ingest/:jobId/batches] EOF
How do I solve this error? How can I tell KrakenD to expect the empty response body?
I am not using any custom plugins.
答案1
得分: 1
你应该检查后端部分定义的编码(默认为JSON),并选择适合后端响应的编码方式。在这里,你可以找到一些建议:https://www.krakend.io/docs/backends/supported-encodings/#how-to-choose-the-backend-encoding
如果你期望得到空响应,你可以使用no-op
(https://www.krakend.io/docs/endpoints/no-op/)。
英文:
You should check the encoding defined at the backend section (by default, it's JSON) and select one that suits your backend responses. Here you'll find some recommendations: https://www.krakend.io/docs/backends/supported-encodings/#how-to-choose-the-backend-encoding
If you are expecting empty responses, you could use no-op
(https://www.krakend.io/docs/endpoints/no-op/)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论