sending a custom User-Agent
This commit is contained in:
parent
799e702a73
commit
858e786f15
|
@ -143,13 +143,12 @@ public class HttpClientLiveTest {
|
||||||
response = client.execute(request);
|
response = client.execute(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@Test
|
@Test
|
||||||
public final void givenDeprecatedApi_whenRequestHasCustomUserAgent_thenCorrect() throws ClientProtocolException, IOException {
|
public final void givenDeprecatedApi_whenRequestHasCustomUserAgent_thenCorrect() throws ClientProtocolException, IOException {
|
||||||
final DefaultHttpClient client = new DefaultHttpClient();
|
instance = HttpClients.custom().build();
|
||||||
final HttpGet request = new HttpGet(SAMPLE_URL);
|
final HttpGet request = new HttpGet(SAMPLE_URL);
|
||||||
request.setHeader(HttpHeaders.USER_AGENT, "Mozilla/5.0 Firefox/26.0");
|
request.setHeader(HttpHeaders.USER_AGENT, "Mozilla/5.0 Firefox/26.0");
|
||||||
response = client.execute(request);
|
response = instance.execute(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue