public class JsonDecoder extends Object implements Decoder
Basic example with Feign.Builder
:
interface GitHub { @RequestLine("GET /repos/{owner}/{repo}/contributors") JSONArray contributors( @Param("owner") String owner, @Param("repo") String repo); } GitHub github = Feign.builder() .decoder(new JsonDecoder()) .target(GitHub.class, "https://api.github.com"); JSONArray contributors = github.contributors("openfeign", "feign"); System.out.println(contributors.getJSONObject(0).getString("login"));
Decoder.Default
Constructor and Description |
---|
JsonDecoder() |
public Object decode(Response response, Type type) throws IOException, DecodeException
decode
in interface Decoder
IOException
DecodeException
Copyright © 2012–2021 OpenFeign. All rights reserved.