import io.github.httpz.HttpZ; public class HttpzExample { public static void main(String[] args) { String url = "http://example.com/api"; HttpZ.get(url) .param("name", "John") .param("age", "25") .header("Authorization", "Bearer xxxxxxxx") .interceptor((request, response) -> { System.out.println("Intercepting request: " + request); System.out.println("Intercepting response: " + response); }) .execute() .then(response -> { System.out.println("Response status code: " + response.getStatus()); System.out.println("Response body: " + response.getBody()); }); } }


上一篇:
下一篇:
切换中文