I have to setup a proxy to send a JSON using POST, using proxyHost and proxyPort.
public static final MediaType JSON = MediaType.parse(\"application/json; charse
okhttp version:3.11.0. SOCKS proxy example
3.11.0
String hostname = "localhost"/*127.0.0.1*/; int port = 1080; Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(hostname, port)); OkHttpClient client = new OkHttpClient.Builder() .proxy(proxy) .build();