huaweicloud-sdk-go-v3
huaweicloud-sdk-go-v3 copied to clipboard
request ContentType ”\n“换行问题
源码中返回的content type会有”/n“换行
麻烦发一下调用接口的代码,谢谢!需要看一下ListRepositoryTagsRequest
中的ListRepositoryTagsRequestContentType
参数是如何指定的。
附上示例代码:
contentType := swrModel.GetListRepositoryTagsRequestContentTypeEnum().APPLICATION_JSON
request := &swrModel.ListRepositoryTagsRequest{
ContentType: contentType,
}
麻烦发一下调用接口的代码,谢谢!需要看一下
ListRepositoryTagsRequest
中的ListRepositoryTagsRequestContentType
参数是如何指定的。 附上示例代码:contentType := swrModel.GetListRepositoryTagsRequestContentTypeEnum().APPLICATION_JSON request := &swrModel.ListRepositoryTagsRequest{ ContentType: contentType, }
你好,代码是这样的
我在macos M1处理器上用go1.17.7运行时没有问题的,同事用macos intel处理器go1.17.6运行会出现content type换行,另一个同事windows go.1.16.8也是ok。
m1 go1.20.0
swr.NewSwrClient(
swr.SwrClientBuilder().
WithRegion(region.ValueOf(regionId)).
WithCredential(auth).
Build()
).ListReposDetails(&model.ListReposDetailsRequest{
ContentType: model.GetListReposDetailsRequestContentTypeEnum().APPLICATION_JSON,
})
可复现
m1 go1.20.0
swr.NewSwrClient( swr.SwrClientBuilder(). WithRegion(region.ValueOf(regionId)). WithCredential(auth). Build() ).ListReposDetails(&model.ListReposDetailsRequest{ ContentType: model.GetListReposDetailsRequestContentTypeEnum().APPLICATION_JSON, })
可复现
0.1.45版本已知问题,请使用之前的版本,或者等待下个版本修复该问题。
m1 go1.20.0
swr.NewSwrClient( swr.SwrClientBuilder(). WithRegion(region.ValueOf(regionId)). WithCredential(auth). Build() ).ListReposDetails(&model.ListReposDetailsRequest{ ContentType: model.GetListReposDetailsRequestContentTypeEnum().APPLICATION_JSON, })
可复现
0.1.45版本已知问题,请使用之前的版本,或者等待下个版本修复该问题。
1.14版本及之后版本的 std json 库的性能已经优于 jsoniter,建议使用 std json 代替 jsoniter,可解决该问题。