javanetflix-feign

Post form with Feign


Is it possible to post form data with NetFlix' Feign library?

@RequestLine("POST /progs/dorules/{vsid}/add/{rsid}")
@Body("%7B\"ADD\": \"add\", \"rule\": \"{rule}\"%7D")
void addRule(
        @Param("rule") String name,
        @Param("vsid") String vsid,
        @Param("rsid") String rsid
);

I want the call to look as follows:

POST https://xxxx/progs/dorules/1/add/80

With Parameters: ADD = Add rule = default

With form type : application/x-www-form-urlencoded


Solution

  • You seem to be a @Headers() away: feign doc