apache / apache/servicecomb-java-chassis
@RequestPart cannot mapping string value,Required request part 'hostname' is not present
- Ngôn ngữ chính
- Java
- Star
- 1.9k
- Fork
- 814
- Merge trung bình
- 8 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
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);
```
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java, spring
- Lĩnh vực
- api, backend
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 30/100