Search in sources :

Example 26 with BufferedHeader

use of org.apache.http.message.BufferedHeader in project jmeter by apache.

the class HTTPHC4Impl method writeResponseHeader.

/**
     * Write responseHeader to headerBuffer in an optimized way
     * @param headerBuffer {@link StringBuilder}
     * @param responseHeader {@link Header}
     */
private void writeResponseHeader(StringBuilder headerBuffer, Header responseHeader) {
    if (responseHeader instanceof BufferedHeader) {
        CharArrayBuffer buffer = ((BufferedHeader) responseHeader).getBuffer();
        // $NON-NLS-1$
        headerBuffer.append(buffer.buffer(), 0, buffer.length()).append('\n');
    } else {
        headerBuffer.append(responseHeader.getName()).append(// $NON-NLS-1$
        ": ").append(responseHeader.getValue()).append(// $NON-NLS-1$
        '\n');
    }
}
Also used : BufferedHeader(org.apache.http.message.BufferedHeader) CharArrayBuffer(org.apache.http.util.CharArrayBuffer)

Example 27 with BufferedHeader

use of org.apache.http.message.BufferedHeader in project platform_external_apache-http by android.

the class RFC2965Spec method getVersionHeader.

@Override
public Header getVersionHeader() {
    CharArrayBuffer buffer = new CharArrayBuffer(40);
    buffer.append(SM.COOKIE2);
    buffer.append(": ");
    buffer.append("$Version=");
    buffer.append(Integer.toString(getVersion()));
    return new BufferedHeader(buffer);
}
Also used : BufferedHeader(org.apache.http.message.BufferedHeader) CharArrayBuffer(org.apache.http.util.CharArrayBuffer)

Aggregations

BufferedHeader (org.apache.http.message.BufferedHeader)27 CharArrayBuffer (org.apache.http.util.CharArrayBuffer)27 ArrayList (java.util.ArrayList)15 Header (org.apache.http.Header)12 ClientCookie (org.apache.http.cookie.ClientCookie)12 Cookie (org.apache.http.cookie.Cookie)12 FormattedHeader (org.apache.http.FormattedHeader)6 AuthenticationException (org.apache.http.auth.AuthenticationException)5 InvalidCredentialsException (org.apache.http.auth.InvalidCredentialsException)5 NTCredentials (org.apache.http.auth.NTCredentials)4 BasicNameValuePair (org.apache.http.message.BasicNameValuePair)3 HttpHost (org.apache.http.HttpHost)1 BasicHeader (org.apache.http.message.BasicHeader)1 GSSContext (org.ietf.jgss.GSSContext)1 GSSException (org.ietf.jgss.GSSException)1 GSSManager (org.ietf.jgss.GSSManager)1 GSSName (org.ietf.jgss.GSSName)1 Oid (org.ietf.jgss.Oid)1