Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to read a .json from web api java

try {
			URL url = new URL("url");
			HttpURLConnection conn = (HttpURLConnection)url.openConnection();
			conn.setRequestMethod("GET");
			conn.connect();
			if(conn.getResponseCode() == 200) {
				Scanner scan = new Scanner(url.openStream());
				while(scan.hasNext()) {
					String temp = scan.nextLine();
                  	//parse json here
                }
            }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java arraylist get second largest value 
Java :: primefaces calendar min date validation 
Java :: glide dependency android java 
Java :: check type of variable java 
Java :: Min value map 
Java :: android studio start activity 
Java :: reverse string in java 
Java :: how to get contacts permission in android 
Java :: java coding problems 
Java :: java is number 
Java :: first and last digit sum java 
Java :: How to efficiently find the index of smallest value that is larger than some target within a sorted array, in Java? 
Java :: converter int array para string java 
Java :: java random string 
Java :: selet all elemnts 
Java :: minecraft java 
Java :: java join list of strings 
Java :: how to read a text file in java 
Java :: how-to-check-internet-connection-in-android 
Java :: java print output 
Java :: junit 5 expected exception 
Java :: offsetdattime to date 
Java :: link to method javadoc 
Java :: how to set spinner value in android 
Java :: display an image java 
Java :: turn ascii into text javascriot 
Java :: @notblank not working in spring boot 
Java :: java for each 
Java :: how to change image resolution in android programmatically 
Java :: jframe visibility 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =