Questions tagged [webclient]

WebClient is a class for .NET Framework applications that provides methods for sending and receiving data from a resource identified by a URI.

Read more about the WebClient class and its usage here: https://learn.microsoft.com/en-us/dotnet/api/system.net.webclient

4098 questions
1
vote
0 answers

How to Remove 'System.Net.WebException' occurred in System.dll where server returned an error code of (500)

I am using webclient to upload my files to server via Rest Service. I am checking my code by debugging it on a local host what I found is my server is successfully receiving all these files but at client end where I have a code for sending file I am…
1
vote
2 answers

powershell webclient uploadfile # in filename

Hi I just tested around with powershell Webclient. Everthing seemed to work fine, but then i had to upload a file with a # in the name (test.#00). The File on the Server just strips the .#00. The file on the server is named "test" instead of…
autlunatic
  • 650
  • 7
  • 17
1
vote
0 answers

How to use Webclient to send params in a file upload form-data request?

I would like to use Webclient(I am consuming it from a console application) over other lower level http libraries. I want to pretty much send a http request like below(this is from fidler but you get the idea): Header: Content-Type:…
RollRoll
  • 8,133
  • 20
  • 76
  • 135
1
vote
1 answer

How to merge two CookieContainers so older cookies are overwritten?

Is there a standard method that does this, or do I have to get every cookie from the CookieContainer using reflection, manually check them, and then add them to a new CookieContainer?
1
vote
1 answer

invoke-webrequest , New-Object -ComObject "InternetExplorer.Application and New-Object net.webclient

i am trying to create task scheduler to get an embed link from a website every hour and i am using powershell to retrieve the info from web. $ie = New-Object -ComObject…
Jimmy
  • 33
  • 4
1
vote
1 answer

Extract content in paragraph Tags

I have following html in string and i have to extract the content only in Paragraph tags any ideas?? link is http://www.public-domain-content.com/books/Coming_Race/C1P1.shtml I have tried const string HTML_TAG_PATTERN = "<[^>]+.*?>"; static…
Afnan Bashir
  • 7,319
  • 20
  • 76
  • 138
1
vote
1 answer

Attaching build configuration to template via API [TeamCity]

I'm trying to attach a build configuration to a template. We're running TeamCity 10.0.2, using PowerShell 4.0 to interact with it. According to the TeamCity 10 API documentation, the attachment of builds to templates operation is possible: Read,…
ShaneC
  • 2,237
  • 2
  • 32
  • 53
1
vote
1 answer

C# Mono - Error: SecureChannelFailure - HTTPS request fails for some domain

After hours by reading all questions about this issue, i have no other choice than posting by myself. I have a very simple C# code which return html code from URL : string url = "https://www.google.fr"; var encoding =…
Okn
  • 698
  • 10
  • 21
1
vote
0 answers

C# Open a web link and wait for a generate file to download

I try to download a PDF file from a Tech File Web Generator in C#. If I use WebCLient, I download the source of the page and not the PDF that will be generated.How I can wait for the generate file and download it? This is the link
1
vote
0 answers

Sending cookie with subkey with webclient

I am trying to access a web page with WebClient class. The page login with cookies, so in order to login and managed cookies with WebClient I used this code (downloaded from web) public class WebClientCookie : WebClient { private…
Lucas
  • 11
  • 1
1
vote
2 answers

Webclient not returning any data

I'm using below given code to download content of a webpage. using (var w = new System.Net.WebClient()) { w.Encoding = System.Text.Encoding.UTF8; w.Headers["User-Agent"] = "Mozilla /…
Newbie
  • 39
  • 1
  • 9
1
vote
1 answer

C# OutOfMemory Exception when reading Post Response

I'm currently working on a simple application that utilizes JSON objects to POST to an API and gets the responding data. However, when I run the POST method, the POST response is so large that I encounter the OutOfMemory Exception. I'm currently…
John Gail
  • 21
  • 7
1
vote
2 answers

is there library rether than HtmlUnit that support javascript

hello i am using htmlunit for the first time and i have the following error . TypeError: Cannot find function enableSuggest in object [object Object]. (script in http://mysite.aspx from (854, 32) to (859, 10)#857)] …
asas
  • 135
  • 1
  • 2
  • 9
1
vote
1 answer

Vb.net webclient error : too many automatic redirections was attempted

This code was running just fine before , but since yesterday the error started to show up. After reading many similar disscutions i though that my problem was about cookies so i add a CookieContainer but i still get the same error. My code allows me…
Amine Tagui
  • 205
  • 2
  • 13
1
vote
1 answer

How can I use System.Net.WebClient like PowerShell New-WebServiceProxy?

The issue I am having connecting to a service via PowerShell, versus using C#, is that the service is expecting a key passed in the header. I can use new-WebServiceProxy with the URI and have it pass the default credentials. I can then get the…