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

com.algorithmia.client.HttpResponse Maven / Gradle / Ivy

The newest version!
package com.algorithmia.client;

import java.io.InputStream;
import java.util.List;
import java.util.Map;

public class HttpResponse {
    public final String url;
    public final int status;
    public final InputStream body;
    public final Map> headers;

    public HttpResponse(String url, int status, InputStream body, Map> headers) {
        this.url = url;
        this.status = status;
        this.body = body;
        this.headers = headers;
    }

    public InputStream getContent() {
        return body;
    }

    public int getStatusCode() {
        return status;
    }

    public String getFirstHeader(String header) {
        List headerList = headers.get(header);
        if(headerList != null) {
            return headerList.get(0);
        } else {
            return null;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy