Skip to content

Commit

Permalink
Additional methods on Http1RequestImpl (#6983)
Browse files Browse the repository at this point in the history
  • Loading branch information
dalexandrov authored Jun 13, 2023
1 parent 90e1210 commit 486e3fa
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import io.helidon.common.http.WritableHeaders;
import io.helidon.common.uri.UriEncoding;
import io.helidon.common.uri.UriFragment;
import io.helidon.common.uri.UriPath;
import io.helidon.common.uri.UriQuery;
import io.helidon.common.uri.UriQueryWriteable;
import io.helidon.nima.common.tls.Tls;
import io.helidon.nima.webclient.ClientConnection;
Expand Down Expand Up @@ -291,6 +293,21 @@ private ClientResponseImpl invokeRequestWithEntity(Object entity) {
return invokeServices(callChain, whenSent, whenComplete);
}

@Override
public Http.Method httpMethod(){
return method;
}

@Override
public UriPath uriPath(){
return UriPath.create(uri.path());
}

@Override
public UriQuery uriQuery(){
return UriQuery.create(resolvedUri());
}

private ClientResponseImpl invokeServices(WebClientService.Chain callChain,
CompletableFuture<WebClientServiceRequest> whenSent,
CompletableFuture<WebClientServiceResponse> whenComplete) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Oracle and/or its affiliates.
* Copyright (c) 2022, 2023 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,11 +16,34 @@

package io.helidon.nima.webclient.http1;

import io.helidon.common.http.Http;
import io.helidon.common.uri.UriPath;
import io.helidon.common.uri.UriQuery;
import io.helidon.nima.webclient.ClientRequest;

/**
* Client request for HTTP/1.1.
*/
public interface Http1ClientRequest extends ClientRequest<Http1ClientRequest, Http1ClientResponse> {

/**
* HTTP Method.
*
* @return {@link Http.Method} the http method
*/
Http.Method httpMethod();

/**
* URI Path.
*
* @return {@link UriPath}
*/
UriPath uriPath();

/**
* URI Query.
*
* @return {@link UriQuery}
*/
UriQuery uriQuery();
}

0 comments on commit 486e3fa

Please sign in to comment.