public URL AppendQueryParameter(string name, string value, bool escape = true) { if (_scheme == "file") { return(this); } if (escape == true) { name = HTTPUtils.URLEncode(name); value = HTTPUtils.URLEncode(value); } if (string.IsNullOrEmpty(_query) == true) { _query = name + "=" + value; } else { _query += "&" + name + "=" + value; } return(this); }
public HTTPRequest AppendCookie(string name, string value, bool escape = true) { string cookie = (headers == null) ? null : headers["Cookie"]; if (escape == true) { name = HTTPUtils.URLEncode(name); value = HTTPUtils.URLEncode(value); } if (string.IsNullOrEmpty(cookie)) { cookie = name + "=" + value; } else { cookie += "; " + name + "=" + value; } return(SetHeader("Cookie", cookie)); }