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

io.femo.http.drivers.DefaultDriver Maven / Gradle / Ivy

Go to download

An easy to use HTTP API, that supports synchronous and asynchronous execution of HTTP request. On android only asynchronous driver is supported. This library has been backported to jdk 7 to retain compatibility with android!

The newest version!
package io.femo.http.drivers;

import io.femo.http.HttpDriver;
import io.femo.http.HttpRequest;
import io.femo.http.HttpResponse;
import io.femo.http.HttpServer;

import java.net.URL;

/**
 * Created by felix on 9/11/15.
 */
public class DefaultDriver extends HttpDriver {

    @Override
    public HttpRequest url(URL url) {
        HttpRequest request = new DefaultHttpRequest(url);
        if(url.getProtocol().toLowerCase().equals("https")) {
            request.https();
        }
        return request;
    }

    @Override
    public HttpServer server(int port, boolean ssl) {
        return new DefaultHttpServer(port, ssl);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy