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

com.iteaj.iot.client.http.impl.DefaultHttpClientProtocol Maven / Gradle / Ivy

The newest version!
package com.iteaj.iot.client.http.impl;

import com.iteaj.iot.client.http.HttpClientProtocol;
import okhttp3.RequestBody;

import java.util.Map;

public class DefaultHttpClientProtocol extends HttpClientProtocol {

    protected DefaultHttpClientProtocol(DefaultHttpClientMessage requestMessage) {
        super(requestMessage);
    }

    public static DefaultHttpClientProtocol get(String url) {
        return new DefaultHttpClientProtocol(DefaultHttpClientMessage.get(url));
    }

    public static DefaultHttpClientProtocol get(String url, Map query) {
        return new DefaultHttpClientProtocol(DefaultHttpClientMessage.get(url, query));
    }

    public static DefaultHttpClientProtocol post(String url) {
        return new DefaultHttpClientProtocol(DefaultHttpClientMessage.post(url));
    }

    public static DefaultHttpClientProtocol post(String url, Map query) {
        return new DefaultHttpClientProtocol(DefaultHttpClientMessage.post(url, query));
    }

    public static DefaultHttpClientProtocol post(String url, Map query, Map body) {
        return new DefaultHttpClientProtocol(DefaultHttpClientMessage.post(url, query, body));
    }

    public static DefaultHttpClientProtocol post(String url, Map query, RequestBody body) {
        return new DefaultHttpClientProtocol(DefaultHttpClientMessage.post(url, query, body));
    }

    @Override
    protected DefaultHttpClientMessage doBuildRequestMessage() {
        return this.requestMessage();
    }

    @Override
    protected DefaultHttpClientMessage doBuildResponseMessage(DefaultHttpClientMessage message) {
        return message;
    }

    @Override
    public  T protocolType() {
        return null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy