import java.io.*; import java.net.*; public class Klient1{ public static void main(String[] arg) throws Exception{ HttpURLConnection yhendus=(HttpURLConnection)new URL("https://ussouthcentral.services.azureml.net/workspaces/66e373b2084d4ffa9395c0e34ce9ccaa/services/086134d1a2fa4e7ca86c67932238b188/execute?api-version=2.0&format=swagger").openConnection(); yhendus.setDoOutput(true); yhendus.setRequestMethod("POST"); yhendus.setRequestProperty( "Content-Type", "application/json" ); yhendus.setRequestProperty("Authorization", "Bearer "+"ExuilNQzbnkIqBfzRhhd5t0N0FtFg0ioximEB2lfx+aVJck+TV3HLFplwV0/bOCiW7//6YbcVzu7onuov4oNgQ=="); String paring="{'Inputs': {'input1': [{'tollid': '2'}]}, 'GlobalParameters': {}}"; yhendus.setRequestProperty("Content-Length", ""+paring.length()); OutputStream os = yhendus.getOutputStream(); os.write(paring.getBytes()); os.flush(); os.close(); BufferedReader lugeja=new BufferedReader(new InputStreamReader(yhendus.getInputStream())); String rida=lugeja.readLine(); while(rida!=null){ System.out.println(rida); rida=lugeja.readLine(); } } }