Search in sources :

Example 1 with HttpMethod

use of com.hotels.styx.api.HttpMethod in project styx by ExpediaGroup.

the class HttpRequestOperation method toNettyRequest.

// Visible for testing
static DefaultHttpRequest toNettyRequest(LiveHttpRequest request) {
    HttpVersion version = request.version();
    HttpMethod method = request.method();
    String url = request.url().toString();
    DefaultHttpRequest nettyRequest = new DefaultHttpRequest(toNettyVersion(version), toNettyMethod(method), url, true);
    request.headers().forEach((name, value) -> nettyRequest.headers().add(name, value));
    return nettyRequest;
}
Also used : DefaultHttpRequest(io.netty.handler.codec.http.DefaultHttpRequest) HttpVersion(com.hotels.styx.api.HttpVersion) HttpMethod(com.hotels.styx.api.HttpMethod)

Aggregations

HttpMethod (com.hotels.styx.api.HttpMethod)1 HttpVersion (com.hotels.styx.api.HttpVersion)1 DefaultHttpRequest (io.netty.handler.codec.http.DefaultHttpRequest)1