mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Added SendRequestURLEncoded
This commit is contained in:
parent
ba9d03d6d8
commit
b6e9543f42
1 changed files with 14 additions and 0 deletions
|
@ -231,6 +231,20 @@ protected string SendRequestJSON(string url, string json, NameValueCollection he
|
|||
}
|
||||
}
|
||||
|
||||
protected string SendRequestURLEncoded(string url, Dictionary<string, string> arguments, NameValueCollection headers = null, CookieCollection cookies = null,
|
||||
HttpMethod method = HttpMethod.POST)
|
||||
{
|
||||
string query = CreateQuery(arguments);
|
||||
byte[] data = Encoding.UTF8.GetBytes(query);
|
||||
|
||||
using (MemoryStream stream = new MemoryStream())
|
||||
{
|
||||
stream.Write(data, 0, data.Length);
|
||||
|
||||
return SendRequestStream(url, stream, "application/x-www-form-urlencoded", headers, cookies, method);
|
||||
}
|
||||
}
|
||||
|
||||
protected string SendRequestStream(string url, Stream stream, string contentType, NameValueCollection headers = null,
|
||||
CookieCollection cookies = null, HttpMethod method = HttpMethod.POST)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue