Json package has HTTP class, which will produce the URL's header info as  JSON object.

HTTP has a static method, which is toJSONObject(String value).

The value will be an URL.


import org.json.HTTP;

public class Header {

	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		System.out.println(HTTP.toJSONObject("http://ampersandacademy.com"));
	}
}


output:

{"Reason-Phrase":"","Status-Code":"","HTTP-Version":"http://ampersandacademy.com"}