KrakenD在后端端点的主体没有任何数据时返回500错误。

huangapple go评论110阅读模式
英文:

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/)

huangapple
  • 本文由 发表于 2023年1月28日 07:44:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/75264367.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定