apache / apache/servicecomb-java-chassis
@RequestPart cannot mapping string value,Required request part 'hostname' is not present
- Lenguaje dominante
- Java
- Estrellas
- 1.9k
- Forks
- 814
- Merge medio
- 8 d 23 h
- PR fusionados (30 d)
- 1
Descripción
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);
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java, spring
- Área
- api, backend
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 30/100