httpclient错误


Caused by: org.apache.http.ProtocolException: Target host is not specified
	at org.apache.http.impl.conn.DefaultRoutePlanner.determineRoute(DefaultRoutePlanner.java:69)
	at org.apache.http.impl.client.InternalHttpClient.determineRoute(InternalHttpClient.java:124)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:183)
	... 3 more
在做httpclient学习的时候一直出现上述问题,把网址manage.atguigu.com/restful/api/content/28放在浏览器栏的时候可以获得json数据,但是通过httpclient不能获得,后面发现是没有加http协议   加上 http://就ok了

你可能感兴趣的:(学习)