apache / apache/servicecomb-java-chassis

@RequestPart cannot mapping string value,Required request part 'hostname' is not present

Open
#3,414 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.9k
Forks
814
Avg merge
8d 23h
Merged PRs (30d)
1

Description

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);
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.