Error, only in this task, every other works fine.
![]()


package en.codegym.task.pro.task15.task1523;
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
/*
Getting information through an API
*/
public class Solution {
public static void main(String[] args) throws IOException {
URL url = new URL("http://httpbin.org/post");
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
connection.setDoInput(true);
try(OutputStream outputStream = connection.getOutputStream();
PrintStream sender = new PrintStream(outputStream)){
sender.println("check");
}
try(InputStream inputStream = connection.getInputStream();
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader)) {
while (bufferedReader.ready()) {
System.out.println(bufferedReader.readLine());
}
}
}
}