Print it into string.
@return Entire HTTP response
@throws IOException If fails
352103
public String print() throws IOException {
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        this.print(baos);
        return new Utf8String(baos.toByteArray()).asString();
    }
1222177
public String toJson() throws IOException {
        ObjectMapper mapper = new ObjectMapper();
        ByteArrayOutputStream out = new ByteArrayOutputStream();

        mapper.writeValue(out, this);
        return out.toString();
    }
216886
@Override
  public void print() throws IOException {
    results.sort(comparator());
    String report = assemble(results);
    String output = settings.report().output();
    if (output.equalsIgnoreCase("console")) {
      System.out.println(report);
    } else {
      Files.write(Paths.get(output), report.getBytes(UTF_8));
    }
  }
1572
public function printResponse()
    {
        $request = $this->request;
        $response = $this->response;

        echo sprintf(
            "%s %s => %d:\n%s",
            $request->getMethod(),
            (string) ($request instanceof RequestInterface ? $request->getUri() : $request->getUrl()),
            $response->getStatusCode(),
            (string) $response->getBody()
        );
    }
59331
public String receiveString() throws IOException {
    int len = pgInput.scanCStringLength();
    String res = encoding.decode(pgInput.getBuffer(), pgInput.getIndex(), len - 1);
    pgInput.skip(len);
    return res;
  }
119353
public byte[] getBytes() throws IOException {
        InputStream input = getInputStream();
        ByteArrayOutputStream output = new ByteArrayOutputStream();

        final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
        int len;

        try {
            while ((len = input.read(buffer)) != -1) {
                output.write(buffer, 0, len);
            }
        } finally {
            try {
                output.close();
            } catch (IOException e) {
                // ignore
            }
            try {
                input.close();
            } catch (IOException e) {
                // ignore
            }
        }

        return output.toByteArray();
    }
1113158
public String text() {
        try {
            connect();
            return responseCode() >= 400 ? read(connection.getErrorStream()) : read(connection.getInputStream());
        } catch (IOException e) {
            throw new HttpException("Failed URL: " + url, e);
        }finally {
            dispose();
        }
    }
1085508
public static String getResponseContent(HttpResponse response) throws IOException {
        final HttpEntity entity = response.getEntity();
        if (entity != null) {
            try {
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                entity.writeTo(out);//call this in any case!!!
                return isScOk(response) ? new String(out.toByteArray(), Charset.forName("UTF-8")) : null;
            } finally {
                //ensure entity is closed.
                EntityUtils.consume(entity);
            }
        } else {
            return null;
        }
    }
34038
public String body() throws HttpException {
		try {
			return HttpUtil.getString(bodyBytes(), this.charset, null == this.charsetFromResponse);
		} catch (IOException e) {
			throw new HttpException(e);
		}
	}
346430
public String asString() throws IOException {
        StringWriter w = new StringWriter();
        writeRawTo(w);
        return w.toString();
    }
1109143
public byte[] getBytes() throws IOException {
        if (!connection.isOpen())
            connection.open();

        connection.prepare("GET");
        response = connection.readInput();
        return getResponseBytes();
    }
257810
public final PrintWriter getWriter() throws IOException {
        if (out == null) {
            // NOTE: getCharacterEncoding may/should not return null
            OutputStream out = createOutputStream();
            String charEncoding = response.getCharacterEncoding();
            this.out = new PrintWriter(charEncoding != null ? new OutputStreamWriter(out, charEncoding) : new OutputStreamWriter(out));
        }
        else if (out instanceof ServletOutputStream) {
            throw new IllegalStateException("getOutputStream() already called.");
        }

        return (PrintWriter) out;
    }
602792
public String printBody() throws IOException {
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        this.printBody(baos);
        return new Utf8String(baos.toByteArray()).asString();
    }
1159127
public static void print(Object o) throws IOException {
		OutputStreamWriter w=new OutputStreamWriter(System.out,"UTF-8");
		print(o, w, true);
		w.flush();
	}
378771
@ManagedOperation(description="Prints the send and receive buffers")
    public String printBuffers() {
        StringBuilder sb=new StringBuilder("\n");
        synchronized(this) {
            for(Map.Entry<Address,Connection> entry: conns.entrySet()) {
                NioConnection val=(NioConnection)entry.getValue();
                sb.append(entry.getKey()).append(":\n  ").append("recv_buf: ").append(val.recv_buf)
                  .append("\n  send_buf: ").append(val.send_buf).append("\n");
            }
        }
        return sb.toString();
    }
274262
public function toString()
    {
        $status = sprintf('HTTP/%s %d %s', $this->getVersion(), $this->getStatusCode(), $this->getStatusMessage());

        $str  = trim($status) . "\r\n";
        $str .= $this->getHeaders();
        $str .= "\r\n";
        $str .= $this->getContent();
        return $str;
    }
555891
public void print(String s) throws IOException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        { // 306998.15
            Tr.debug(tc, "print --> " + s);
        }
        if (!_hasWritten && obs != null)
        {
            _hasWritten = true;
            obs.alertFirstWrite();
        }
        int len = s.length();
        if (limit > -1)
        {
            if (total + len > limit)
            {
                len = (int)(limit - total);
                except = new WriteBeyondContentLengthException();
            }
        }

        int off = 0;
        while (len > 0)
        {
            int n = buf.length - count;
            if (n == 0)
            {
                response.setFlushMode(false);
                flushChars();
                response.setFlushMode(true);
                n = buf.length - count;
            }
            if (n > len)
            {
                n = len;
            }

            s.getChars(off, off + n, buf, count);

            count += n;
            total += n;
            off += n;
            len -= n;
        }
        check();
    }