Tricky
Tricky

Reputation: 145

HttpUrlConnection wont get a page

Trying to get page with

http:www.thecinemas.aw/main/?date=2012-11-01

doesn't work anything. But

http://www.thecinemas.aw/main/movies/details.html?id=1421

does work.

The only difference I can see is the use of a minus (-) in the first one.

Any suggestions on how I can solve this?

Upvotes: 0

Views: 55

Answers (2)

Reimeus
Reimeus

Reputation: 159784

The first URL should start with http://, otherwise the protocol prefix is not valid.

Upvotes: 2

Trần Sĩ Long
Trần Sĩ Long

Reputation: 477

use:

URI uri = new URI("http", "www.thecinemas.aw", "/main/?date=2012-11-01",null);
URL url = uri.toURL();

Upvotes: 1

Related Questions