-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
Description

这是我用apifox调通的写法,body需要设置为application/json,但是整个请求要是form-data的
这是我调不通的错误代码,提示:Content type 'application/octet-stream' not supported
@Override
public ApiResponse<?> applyDataCatalog(DataCatalogApplyDTO dataCatalogApplyDTO) {
HttpRequest request = HttpUtil.createPost(CatalogProperties.getBaseUrl() + "/api/service/dataSourceShareApply");
String jsonBody = JSONUtil.toJsonStr(dataCatalogApplyDTO);
request.header("Content-Type", "multipart/form-data");
request.form("body", jsonBody);
HttpResponse response = request.execute();
System.out.println(request.headers());
System.out.println(response.body());
return ApiResponse.success(response.body());
}Reactions are currently unavailable
