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

org.codelibs.elasticsearch.runner.net.Curl Maven / Gradle / Ivy

There is a newer version: 7.10.2.0
Show newest version
package org.codelibs.elasticsearch.runner.net;

import java.net.HttpURLConnection;

import org.elasticsearch.node.Node;

public class Curl {

    protected Curl() {
        // nothing
    }

    public static CurlRequest get(final Node node, final String path) {
        return new CurlRequest(Method.GET, node, path);
    }

    public static CurlRequest post(final Node node, final String path) {
        return new CurlRequest(Method.POST, node, path);
    }

    public static CurlRequest put(final Node node, final String path) {
        return new CurlRequest(Method.PUT, node, path);
    }

    public static CurlRequest delete(final Node node, final String path) {
        return new CurlRequest(Method.DELETE, node, path);
    }

    public static CurlRequest get(final String url) {
        return new CurlRequest(Method.GET, url);
    }

    public static CurlRequest post(final String url) {
        return new CurlRequest(Method.POST, url);
    }

    public static CurlRequest put(final String url) {
        return new CurlRequest(Method.PUT, url);
    }

    public static CurlRequest delete(final String url) {
        return new CurlRequest(Method.DELETE, url);
    }

    public enum Method {
        GET, POST, PUT, DELETE;
    }

    public interface ResponseListener {
        public void onResponse(HttpURLConnection con);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy