public class JsonEncoder extends Object implements feign.codec.Encoder
Basic example with Feign.Builder
:
interface GitHub { @RequestLine("POST /repos/{owner}/{repo}/contributors") JSONObject create( @Param("owner") String owner, @@Param("repo") String repo, JSONObject contributor); } GitHub github = Feign.builder() .decoder(new JsonDecoder()) .encoder(new JsonEncoder()) .target(GitHub.class, "https://api.github.com"); JSONObject contributor = new JSONObject(); contributor.put("login", "radio-rogal"); contributor.put("contributions", 0); github.create("openfeign", "feign", contributor);
Constructor and Description |
---|
JsonEncoder() |
Modifier and Type | Method and Description |
---|---|
void |
encode(Object object,
Type bodyType,
feign.RequestTemplate template) |
Copyright © 2012–2025 OpenFeign. All rights reserved.