use of io.servicetalk.http.api.StreamingHttpRequest in project servicetalk by apple.
the class MultiAddressUrlHttpClientTest method requestWithRequestTargetWithoutScheme.
@Test
void requestWithRequestTargetWithoutScheme() {
StreamingHttpRequest request = client.get(format("%s/200?param=value#tag", hostHeader));
// no host header
toSource(client.request(request)).subscribe(subscriber);
assertThat(subscriber.awaitOnError(), is(instanceOf(MalformedURLException.class)));
}
use of io.servicetalk.http.api.StreamingHttpRequest in project servicetalk by apple.
the class MultiAddressUrlHttpClientTest method requestWithAbsoluteFormRequestTargetWithoutHostHeader.
@Test
void requestWithAbsoluteFormRequestTargetWithoutHostHeader() throws Exception {
StreamingHttpRequest request = client.get(format("http://%s/200?param=value#tag", hostHeader));
requestAndValidate(request, OK, "/200?param=value#tag");
}
use of io.servicetalk.http.api.StreamingHttpRequest in project servicetalk by apple.
the class MultiAddressUrlHttpClientTest method requestWithIncorrectPortInAbsoluteFormRequestTarget.
@Test
void requestWithIncorrectPortInAbsoluteFormRequestTarget() {
StreamingHttpRequest request = client.get(format("http://%s:-1/200?param=value#tag", serverHost));
toSource(client.request(request)).subscribe(subscriber);
assertThat(subscriber.awaitOnError(), is(instanceOf(IllegalArgumentException.class)));
}
use of io.servicetalk.http.api.StreamingHttpRequest in project servicetalk by apple.
the class MultiAddressUrlHttpClientTest method makeGetRequestAndValidate.
private static void makeGetRequestAndValidate(final String hostHeader, final HttpResponseStatus status) throws Exception {
StreamingHttpRequest request = client.get(format("http://%s/%d?param=value#tag", hostHeader, status.code()));
requestAndValidate(request, status, format("/%d?param=value#tag", status.code()));
}
use of io.servicetalk.http.api.StreamingHttpRequest in project servicetalk by apple.
the class MultiAddressUrlHttpClientTest method requestWithRelativeFormRequestTargetAndHostHeader.
@Test
void requestWithRelativeFormRequestTargetAndHostHeader() {
StreamingHttpRequest request = client.get("/200?param=value");
request.headers().set(HOST, hostHeader);
toSource(client.request(request)).subscribe(subscriber);
assertThat(subscriber.awaitOnError(), is(instanceOf(MalformedURLException.class)));
}
Aggregations