com.volcengine.model.response.RawResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of volc-sdk-java Show documentation
Show all versions of volc-sdk-java Show documentation
The VOLC Engine SDK for Java
package com.volcengine.model.response;
import lombok.Data;
import org.apache.http.Header;
@Data
public class RawResponse {
private byte[] data;
private int code;
private Exception exception;
//response header and origin http response code
private Header[] headers;
private int httpCode;
public RawResponse(byte[] data, int code, Exception e) {
this.data = data;
this.code = code;
this.exception = e;
}
public RawResponse(byte[] data, int code, Exception exception, Header[] headers) {
this.data = data;
this.code = code;
this.exception = exception;
this.headers = headers;
}
public RawResponse(byte[] data, int code, Exception exception, Header[] headers, int httpCode) {
this.data = data;
this.code = code;
this.exception = exception;
this.headers = headers;
this.httpCode = httpCode;
}
public String getFirstHeader(String key) {
if (key != null && headers != null) {
for (Header header : headers) {
if (header.getName().equalsIgnoreCase(key)) {
return header.getValue();
}
}
}
return null;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy