tagged [webclient]

Read file from FTP to memory in C#

Read file from FTP to memory in C# I want to read a file from a FTP server without downloading it to a local file. I wrote a function but it does not work: ``` private string GetServerVersion() { We...

13 Nov at 07:28

WebClient class doesn't exist in Windows 8

WebClient class doesn't exist in Windows 8 I want to use a HTTP webservice, and I've already developed an app for wp7. I use the WebClient class, but I can not use it for windows 8 ("error: type or na...

Use WebClient with socks proxy

Use WebClient with socks proxy Is there any way to use a socks proxy with `WebClient`? Specifically with the `DownloadString` method that it provides? I don't want to use any third party stuff like p...

31 Aug at 00:39

C# WebClient acting slow the first time

C# WebClient acting slow the first time I am using a WebClient to download a string from a website (which just contains plain text, nothing else), so I use the DownloadString method: It works fine, bu...

28 Oct at 18:15

How to get a JSON string from URL?

How to get a JSON string from URL? I'm switching my code form XML to JSON. But I can't find how to get a JSON string from a given URL. The URL is something like this: "https://api.facebook.com/method/...

Send POST with WebClient.DownloadString in C#

Send POST with WebClient.DownloadString in C# I know there are a lot of questions about sending HTTP POST requests with C#, but I'm looking for a method that uses `WebClient` rather than `HttpWebReque...

28 Nov at 00:51

HTTP POST Returns Error: 417 "Expectation Failed."

HTTP POST Returns Error: 417 "Expectation Failed." When I try to POST to a URL it results in the following exception: > The remote server returned an error: (417) Expectation Failed. Here's a sample ...

31 May at 16:44

How to use verb GET with WebClient request?

How to use verb GET with WebClient request? How might I change the verb of a WebClient request? It seems to only allow/default to POST, even in the case of DownloadString. ``` try { WebClien...

23 Nov at 19:40

How to make my web scraper log in to this website via C#

How to make my web scraper log in to this website via C# I have an application that reads parts of the source code on a website. That all works; but the problem is that the page in question requires t...

19 Dec at 20:36

WebClient - get response body on error status code

WebClient - get response body on error status code I'm looking essentially for the same thing asked here: [Any way to access response body using WebClient when the server returns an error?](https://st...

23 May at 12:0

How to use HttpClient without async

How to use HttpClient without async Hello I'm following to [this guide](https://learn.microsoft.com/en-us/aspnet/web-api/overview/advanced/calling-a-web-api-from-a-net-client) ``` static async Task Ge...

9 Aug at 05:12

WebClient accessing page with credentials

WebClient accessing page with credentials I am trying to access a webpage on a same domain / same asp.net application, that is password protected. Credentials are the same both for webpage firing this...

WebClient - The remote server returned an error: (403) Forbidden

WebClient - The remote server returned an error: (403) Forbidden Opening a public page from browser works fine. Downloading same page using WebClient throws - (403) Forbidden. What is going on here ? ...

8 May at 13:58

Get original filename when downloading with WebClient

Get original filename when downloading with WebClient Is there any way to know the original name of a file you download using the WebClient when the Uri doesn't contain the name? This happens for exam...

26 Feb at 10:51

How to change the timeout on a .NET WebClient object

How to change the timeout on a .NET WebClient object I am trying to download a client's data to my local machine (programatically) and their webserver is very, very slow which is causing a timeout in ...

24 Nov at 11:59

WebProxy error: Proxy Authentication Required

WebProxy error: Proxy Authentication Required I use the following code to obtaing html data from the internet: But the followi

How to set WebClient Content-Type Header?

How to set WebClient Content-Type Header? To conect to a third party service I need to make a Https Post. One of the requisites set is to sent a custom content type. I'm using WebClient, but I can't f...

10 Dec at 06:38

How do I authenticate a WebClient request?

How do I authenticate a WebClient request? I am making a call to a page on my site using webclient. I'm trying to get the result of the webpage put into a pdf so I am trying to get a string representa...

10 Dec at 20:9

WebClient DownloadString UTF-8 not displaying international characters

WebClient DownloadString UTF-8 not displaying international characters I attempt to save the html of a website in a string. The website has international characters (ę, ś, ć, ...) and they are not bei...

9 Mar at 04:31

WebClient is very slow

WebClient is very slow I have problem with Webclient. It is very slow. It takes about 3-5 seconds to downloadString from one website. I don't have any network problems. This is my Modifed WebClient. `...

Send file+parameters in post request

Send file+parameters in post request I'm using this code to send parameters to a webpage and getting correct response from it. ``` System.Net.WebClient oWeb = new System.Net.WebClient(); oWeb.Proxy = ...

25 Sep at 06:21

How do I create a directory on FTP server using C#?

How do I create a directory on FTP server using C#? What's an easy way to create a directory on an FTP server using C#? I figured out how to upload a file to an already existing folder like this: Howe...

24 Jun at 15:37

How to get status code from webclient?

How to get status code from webclient? I am using the `WebClient` class to post some data to a web form. I would like to get the response status code of the form submission. So far I've found out how ...

15 Nov at 14:55

WebClient generates (401) Unauthorized error

WebClient generates (401) Unauthorized error I have the following code running in a windows service: Each time, I get the following exception With the

27 Jan at 20:53

C# - How to make a HTTP call

C# - How to make a HTTP call I wanted to make an HTTP call to a website. I just need to hit the URL and dont want to upload or download any data. What is the easiest and fastest way to do it. I tried ...

7 Oct at 14:9