spring - Feign Client + Eureka POST request body -


i'm trying use feign , eureka forward post request server server b. both servers discrovered sucessfully eureka.

this works:

@feignclient public interface myfeignclient {     @requestmapping(value = "test", = requestmethod.post, consumes = "application/json")     responseentity<string> theactualmethod(             httpservletrequest request,             @requestheader("firstheader") string header1,             @requestheader("secondheader") byte[] header2); } 

however, when change second argument @requestbody in order read post request content, exception:

java.lang.illegalstateexception: method has many body parameters: public abstract org.springframework.http.responseentity myfeignclient.theactualmethod(javax.servlet.http.httpservletrequest,java.lang.string,byte[]) 

the problem method in feign interface cannot have more 1 'general' argument. can have many header arguments want not more 1 body. since @requestbody doesn't regarded not header variable in addition httpservletrequest request variable.

so had change business logic have 1 parameter.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -