RAHUL GUPTA
RAHUL GUPTA

Reputation: 49

i'm trying to build url but getting exception

HttpUrl url = new HttpUrl.Builder().scheme("http")
                .host("localhost:8080") // here I'm getting error
                .addPathSegment("organization").build();

And this is error => java.lang.IllegalArgumentException: unexpected host: localhost:8080

Upvotes: 0

Views: 375

Answers (1)

rzwitserloot
rzwitserloot

Reputation: 102822

It's:

HttpUrl url = new HttpUrl.Builder().scheme("http")
            .host("localhost")
            .port(8080)
            .addPathSegment("organization").build();

Upvotes: 4

Related Questions