internal static String GetName(THTTP_Header header) { if (header != null) { if (header.Type == thttp_header_type_t.Dummy) { // return (header as THTTP_HeaderDummy).Name; } else { return(THTTP_Header.GetName(header.Type)); } } return("unknown-header"); }
internal static char GetParamSeparator(THTTP_Header header) { if (header != null) { switch (header.Type) { case thttp_header_type_t.Authorization: case thttp_header_type_t.Proxy_Authorization: case thttp_header_type_t.Proxy_Authenticate: case thttp_header_type_t.WWW_Authenticate: return(','); default: return(';'); } } return('\0'); }
public static String ToString(THTTP_Header header, Boolean with_name, Boolean with_crlf, Boolean with_params) { if (header != null) { String @params = String.Empty; if (with_params) { foreach (TSK_Param param in header.Params) { @params += String.Format(!String.IsNullOrEmpty(param.Value) ? "{0}{1}={2}" : "{0}{1}", header.ParamSeparator, param.Name, param.Value); } } return(String.Format("{0}{1}{2}{3}{4}", with_name ? header.Name : String.Empty, with_name ? ": " : String.Empty, header.Value, @params, with_crlf ? "\r\n" : String.Empty)); } return(String.Empty); }
internal static char GetParamSeparator(THTTP_Header header) { if (header != null) { switch (header.Type) { case thttp_header_type_t.Authorization: case thttp_header_type_t.Proxy_Authorization: case thttp_header_type_t.Proxy_Authenticate: case thttp_header_type_t.WWW_Authenticate: return ','; default: return ';'; } } return '\0'; }
internal static String GetName(THTTP_Header header) { if (header != null) { if (header.Type == thttp_header_type_t.Dummy) { // return (header as THTTP_HeaderDummy).Name; } else { return THTTP_Header.GetName(header.Type); } } return "unknown-header"; }
public static String ToString(THTTP_Header header, Boolean with_name, Boolean with_crlf, Boolean with_params) { if (header != null) { String @params = String.Empty; if (with_params) { foreach (TSK_Param param in header.Params) { @params += String.Format(!String.IsNullOrEmpty(param.Value) ? "{0}{1}={2}" : "{0}{1}", header.ParamSeparator, param.Name, param.Value); } } return String.Format("{0}{1}{2}{3}{4}", with_name ? header.Name : String.Empty, with_name ? ": " : String.Empty, header.Value, @params, with_crlf ? "\r\n" : String.Empty); } return String.Empty; }
public String ToString(Boolean with_name, Boolean with_crlf, Boolean with_params) { return(THTTP_Header.ToString(this, with_name, with_crlf, with_params)); }