All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.nagyesta.lowkeyvault.http.ApacheHttpRequest Maven / Gradle / Ivy

There is a newer version: 2.5.93
Show newest version
package com.github.nagyesta.lowkeyvault.http;

import com.azure.core.http.HttpHeaders;
import com.azure.core.http.HttpMethod;
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;

import java.net.URISyntaxException;
import java.net.URL;
import java.util.Objects;

final class ApacheHttpRequest extends HttpEntityEnclosingRequestBase {
    private final String method;

    ApacheHttpRequest(final HttpMethod method, final URL url, final HttpHeaders headers) throws URISyntaxException {
        this.method = method.name();
        setURI(Objects.requireNonNull(ClientUriUtil.revertPortHack(url)).toURI());
        headers.stream().forEach(header -> addHeader(header.getName(), header.getValue()));
    }

    @Override
    public String getMethod() {
        return method;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy