com.aliyuncs.v5.http.HttpResponse Maven / Gradle / Ivy
package com.aliyuncs.v5.http;
import lombok.ToString;
@ToString(callSuper = true)
public class HttpResponse extends HttpMessage {
private int status;
private String reasonPhrase;
public HttpResponse(String strUrl) {
super(strUrl);
}
public HttpResponse() {
}
@Override
public void setHttpContent(byte[] content, String encoding, FormatType format) {
this.httpContent = content;
this.encoding = encoding;
this.httpContentType = format;
}
@Override
public String getHeaderValue(String name) {
String value = this.headers.get(name);
if (null == value) {
value = this.headers.get(name.toLowerCase());
}
return value;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public boolean isSuccess() {
return 200 <= this.status && this.status < 300;
}
public String getReasonPhrase() {
return reasonPhrase;
}
public void setReasonPhrase(String reasonPhrase) {
this.reasonPhrase = reasonPhrase;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy