kratos
kratos copied to clipboard
[Feature] multipart/form-data encoding
for current version kratos display error
{
"code": 400,
"reason": "CODEC",
"message": "unregister Content-Type: multipart/form-data; boundary=--------------------------187292697950545999179746",
"metadata": {}
}
as discussed before,https://github.com/go-kratos/kratos/issues/2198
it is not nessary to define mutipart/form-data
in proto,we can define a service as normal,and make a function to overwrite the method in splitted go file ,so that the kratos generated code and be reused and the api can also be included in the openapi file.
The HTTP interface defined by proto does not support uploading files https://github.com/go-kratos/examples/tree/main/http/upload
对于当前版本的 Kratos 显示错误
{ "code": 400, "reason": "CODEC", "message": "unregister Content-Type: multipart/form-data; boundary=--------------------------187292697950545999179746", "metadata": {} }
如前所述,#2198 在 Proto 中定义是不合适的,我们可以像往常一样定义一个服务,并在拆分后的 Go 文件中做一个函数来覆盖方法,这样 Kratos 生成的代码就可以被复用,API 也可以包含在 OpenAPI 文件中。
mutipart/form-data
你好,我想问下,你最后是怎么解决的?