Reputation: 1
Have some request
@FeignClient(
name = "FeignServer",
url = "url",
configuration = FeignProxyConfiguration.class)
public interface ServerFeign {
@PostMapping(consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
ResponseEntity<String> sendCode(@RequestBody Dto dto);
@AllArgsConstructor
@NoArgsConstructor
@Setter
@Getter
@Builder
public class Dto {
@FormProperty("val_n1")
private String valN1;
@FormProperty("val_n2")
private String valN2;
@FormProperty("val_n3")
private String valN3;
}
@Bean
@Primary
@Scope(SCOPE_PROTOTYPE)
public FormEncoder feignFormEncoder() {
return new FormEncoder(new SpringEncoder(this.messageConverters));
}
Tunneling proxy server works good. But reciver got only first value 'val_n1', how can I send all values using POST form-url-encoded ?
Upvotes: 0
Views: 59
Reputation: 1
The problem was in url paramets, like host/?param1=1¶m2=2&parm3=3, only first param recieved, I have changed param to body. Change Feign client to RestTemplate. Some code, RestTemplate with proxy.
Upvotes: 0