Skip to content

Instantly share code, notes, and snippets.

@novachevskyi
Created July 4, 2017 14:59
Show Gist options
  • Save novachevskyi/12b59e53d6162fb1cd4e6236b03fb504 to your computer and use it in GitHub Desktop.
Save novachevskyi/12b59e53d6162fb1cd4e6236b03fb504 to your computer and use it in GitHub Desktop.
package com.novachevskyi.okhttptest;
import org.junit.Test;
import okhttp3.HttpUrl;
import static org.junit.Assert.assertEquals;
public class OkHttpBug {
@Test
public void test() throws Exception {
HttpUrl.Builder builder = HttpUrl.parse("https://www.google.com/mobile/#!/id").newBuilder();
builder.addQueryParameter("platform", "android");
String url = builder.build().toString();
assertEquals("https://www.google.com/mobile/#!/id?platform=android", url);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment