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
1 answer

WebClient UploadFile Does Not Work

I'm using C#, WinForm, This code. I have modified the XML file and uploaded it to the web server, but the XML file is missing from the web server. but debugging is good working and WebClient Download works well. using (WebClient client = new…
Prio Choi
  • 13
  • 1
  • 5
1
vote
1 answer

Download Image From Url not Working Well C#

I want to download an image from an URL. My class: public class MyWebClient : WebClient { public TimeSpan Timeout { get; set; } protected override WebRequest GetWebRequest(Uri uri) { WebRequest request =…
Mr Alemi
  • 830
  • 1
  • 10
  • 21
1
vote
1 answer

FailingHttpStatusCodeException: 401 Unauthorized acess using HtmlUnit

I'm trying to connect to a page using HtmlUnit using this code: WebClient webClient = new WebClient(); webClient.getOptions().setThrowExceptionOnScriptError(false); HtmlPage loginPage = webClient.getPage(WEBSPHERE_URL); But I'm always getting this…
cmsantos
  • 317
  • 1
  • 4
  • 13
1
vote
2 answers

Is it possible to use WebClient to retrieve a file from the browser cache without checking for a newer version of the file?

I am using an instance of WebClient in my Silverlight application to retrieve an image file for display. In order to service this application, I have set up a WCF REST service. The following is a snippet of code I wrote for that service: DateTime…
Jimmy W
  • 539
  • 3
  • 11
1
vote
0 answers

Connecting to GameWisp Singularity using WebSocket4Net results in failed handshake? C#

I am trying to connect a client to the GameWisp Realtime API using WebSocket4Net. My connection code looks like this: public void Connect(string OAuth) { LoginData login = new LoginData(GAMEWISP_CLIENT_ID, GAMEWISP_CLIENT_SECRET); …
AndideBob
  • 150
  • 1
  • 2
  • 9
1
vote
0 answers

How to use a blob url in WebClient to download a file

While there is no issue in downloading a file from an normal url, there is an issue i am getting when passed a blob url to download the file. The file is able to download but with empty content. Below is my code: WebClient downloader = new…
1
vote
1 answer

C# WebClient DownloadString and DownloadFile giving different results

I am attempting to retrieve some information from a website, parse out a specific item, and then move on with my life. I noticed that when I check "view source" on the website, the results match with what I see when I use the WebClient class'…
1
vote
1 answer

C# - How to Submit 2 Different Forms and Download a PDF File

I am trying to submit a form (via WebClient - C# WindowsForms) but I do not get it yet. My HTTP page sequence is: Username_Form > Password_Form > Download PDF File
1
vote
2 answers

Angular 2: Downloading a ZIP as blob fails

I guess my back-end works, because this works and the zip is fine: curl -X POST -H 'Content-Type: application/json' -d '{}' http://localhost:3000/zip/create > file.zip My Django back-end returns the data like this: return HttpResponse(data,…
user2061057
  • 962
  • 1
  • 9
  • 20
1
vote
3 answers

How can I upload data and a file in the same post?

I need to upload a pdf file and a phone number to a service that will send a fax. The form that works (from a webpage) looks like this:
juan
  • 80,295
  • 52
  • 162
  • 195
1
vote
1 answer

C# WPF WebClient.DownloadString() not returning anything

I started off with the simple code below in order to grab the html from webpages into a string to later process. For some sites like Digikey it works but for others like Mouser it doesn't. I have tried putting headers and userAgents onto the…
Tyler Fontaine
  • 131
  • 2
  • 12
1
vote
1 answer

System.Net.WebException: Unable to read data from the transport connection: The connection was closed.

Sometimes the following error occurs by downloading a (large) file: System.Net.WebException: An exception occurred during a WebClient request. ---> System.IO.IOException: Unable to read data from the transport connection: The connection was…
IchBestäube
  • 61
  • 3
  • 11
1
vote
1 answer

web browser client how to capture something like a document completed event AFTER THE JAVASCRIPT HAS LOADED

So i want to get the visible content of a page using a web browser control, the programming language does't matter C# or VB is totally fine, i am already using something like this Dim wb As New…
Stefan
  • 11
  • 3
1
vote
0 answers

Get body response from webclient uploadstring

I have the following code which post a couple of variables to a webapi n.UploadString("https://192.168.201.10/api/v1/auth/login", "POST", data); I can use n.ResponseHeaders.Get("X-Access-Token"); To simply get the post response headers. But I also…
Erwin Vorenhout
  • 181
  • 1
  • 5
  • 20
1
vote
2 answers

Send specific packets with HttpWebRequest

Hey. Is it possible to send a packet from a C# application without using sockets? I'd like to use WebClient or HttpWebRequest in order to send specifically formatted packets to a server. Examples I've seen tend to use UDP client. Thanks
Skoder
  • 3,983
  • 11
  • 46
  • 73
1 2 3
99
100