![JAR search and dependency download from the Maven repository](/logo.png)
io.ultreia.gc.http.GcRequest Maven / Gradle / Ivy
package io.ultreia.gc.http;
/*
* #%L
* GC toolkit :: API
* %%
* Copyright (C) 2017 Ultreia.io
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* .
* #L%
*/
import java.io.File;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.apache.http.NameValuePair;
/**
* Created on 06/09/15.
*
* @author Tony Chemit - [email protected]
*/
public class GcRequest {
private final String requestMethod;
private final String baseUrl;
private final String contentType;
private final String requestBody;
private final Map headers;
private final List parameters;
private final Map files;
private final int timeout;
GcRequest(String requestMethod,
String baseUrl,
String requestBody,
String contentType,
Map header,
List params,
Map files,
int timeout) {
this.requestMethod = requestMethod;
this.baseUrl = baseUrl;
this.requestBody = requestBody;
this.contentType = contentType;
this.headers = Collections.unmodifiableMap(header);
this.parameters = Collections.unmodifiableList(params);
this.files = Collections.unmodifiableMap(files);
this.timeout = timeout;
}
public String getRequestMethod() {
return requestMethod;
}
public String getBaseUrl() {
return baseUrl;
}
public String getContentType() {
return contentType;
}
public String getRequestBody() {
return requestBody;
}
public Map getHeaders() {
return headers;
}
public List getParameters() {
return parameters;
}
public Map getFiles() {
return files;
}
public boolean withoutFiles() {
return files.isEmpty();
}
public int getTimeout() {
return timeout;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy