apache / apache/servicecomb-java-chassis
@RequestPart cannot mapping string value,Required request part 'hostname' is not present
- 主要语言
- Java
- 星标
- 1.9k
- 派生
- 814
- 平均合并
- 8 天 23 小时
- 30 天内合并 PR
- 1
描述
ServerCode
```
@PostMapping("/uploadLog")
public String uploadAnalysisLog(@RequestPart String hostname, @RequestPart MultipartFile runLog)
```
ClientCode
```
MultiValueMap form = new LinkedMultiValueMap<>();
form.add("runLog", fileResource);
form.add("hostname", hostname);
HttpEntity> body = new HttpEntity<>(form, headers);
RestTemplate restTemplate = HttpRestClient.getRestTemplateCse();
String result = restTemplate.postForObject(UPLOAD_LOG_URL, body, String.class);
```
贡献指南
这个仓库没有索引到贡献指南
调研方向
Reproduce the multipart request using the uploadAnalysisLog endpoint and the RestTemplate.postForObject client shown in the issue. Trace how the @RequestPart hostname value is handled alongside runLog, then verify that the request is accepted without the required-part error.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, spring
- 领域
- api, backend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 30/100