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 ContentLengthTest method shouldCalculateRequestContentLengthFromTwoItemPublisher.
@Test
void shouldCalculateRequestContentLengthFromTwoItemPublisher() throws Exception {
StreamingHttpRequest request = newAggregatedRequest().toStreamingRequest().payloadBody(from("Hello", "World"), appSerializerUtf8FixLen());
setRequestContentLengthAndVerify(request, contentEqualTo("18"));
}
use of io.servicetalk.http.api.StreamingHttpRequest in project servicetalk by apple.
the class ContentLengthTest method shouldNotCalculateRequestContentLengthFromEmptyPublisher.
private static void shouldNotCalculateRequestContentLengthFromEmptyPublisher(HttpRequestMethod method) throws Exception {
StreamingHttpRequest request = newAggregatedRequest(method).toStreamingRequest().payloadBody(Publisher.empty());
setRequestContentLengthAndVerify(request, nullValue(CharSequence.class));
}
use of io.servicetalk.http.api.StreamingHttpRequest in project servicetalk by apple.
the class ContentLengthTest method shouldCalculateRequestContentLengthFromMultipleItemPublisher.
@Test
void shouldCalculateRequestContentLengthFromMultipleItemPublisher() throws Exception {
StreamingHttpRequest request = newAggregatedRequest().toStreamingRequest().payloadBody(from("Hello", " ", "World", "!"), appSerializerUtf8FixLen());
setRequestContentLengthAndVerify(request, contentEqualTo("28"));
}
Aggregations