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

cn.zcltd.http.response.StringHttpResponseResult Maven / Gradle / Ivy

There is a newer version: 4.0.10
Show newest version
package cn.zcltd.http.response;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * http请求返回结果
 */
public class StringHttpResponseResult extends HttpResponseResult {
    protected String responseStr;

    public StringHttpResponseResult(String responseStr) {
        this.responseStr = responseStr;
    }

    public String getResponseStr() {
        return responseStr;
    }

    @Override
    public InputStream getResponseBody() throws IOException {
        return new ByteArrayInputStream(responseStr.getBytes(this.charset));
    }

    @Override
    public String toString() {
        return "StringHttpResponseResult{" +
                "headerMap=" + headerMap +
                "responseStr='" + responseStr + '\'' +
                '}';
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy