admin管理员组文章数量:1026250
(I checked on Network tab for the website itself and it can upload ~1500 lines of code) When I try to execute the code,
Error: System.UriFormatException: InvalidURI: The Uri string is too long.
if (Input.Text.Replace(" ", "").Length == 0) {
PGD.Content = "You must fill out the text box!";
return;
}
try
{
using (var wc = new HttpClient())
{
wc.DefaultRequestHeaders.Add("User-Agent", "FlameIgniterDPasteTool");
var x1 = new MultipartFormDataContent
{
{ new StringContent(Uri.EscapeDataString(Input.Text), Encoding.UTF8, "application/x-www-form-urlencoded"), "content" }
};
HttpResponseMessage res = await wc.PostAsync("/", x1);
PGD.Content = res.Content.ReadAsStringAsync();
}
}
catch (Exception ex) {
PGD.Content = "Error: " + ex.ToString();
}
Progress.IsEnabled = false;
await Task.Delay(1000);
Progress.IsEnabled = true;
Input.Text -> A text box for user to enter to be posted to DPaste
(I checked on Network tab for the website itself and it can upload ~1500 lines of code) When I try to execute the code,
Error: System.UriFormatException: InvalidURI: The Uri string is too long.
if (Input.Text.Replace(" ", "").Length == 0) {
PGD.Content = "You must fill out the text box!";
return;
}
try
{
using (var wc = new HttpClient())
{
wc.DefaultRequestHeaders.Add("User-Agent", "FlameIgniterDPasteTool");
var x1 = new MultipartFormDataContent
{
{ new StringContent(Uri.EscapeDataString(Input.Text), Encoding.UTF8, "application/x-www-form-urlencoded"), "content" }
};
HttpResponseMessage res = await wc.PostAsync("/", x1);
PGD.Content = res.Content.ReadAsStringAsync();
}
}
catch (Exception ex) {
PGD.Content = "Error: " + ex.ToString();
}
Progress.IsEnabled = false;
await Task.Delay(1000);
Progress.IsEnabled = true;
Input.Text -> A text box for user to enter to be posted to DPaste
本文标签: cUri string is too long when attempt to post a large payloadStack Overflow
版权声明:本文标题:c# - Uri string is too long when attempt to post a large payload - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745628369a2160005.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论