webrequest

Send data to webserver from C#, what's the most efficient way?

I am sending gps coordinates from a windows mobile phone to a webserver using a basic program I wrote in C#. The problem is the data plan on the phone only allows 4 MB per month. I was planning on updating the location every 10 seconds. Currently I am just creating a webrequest every 10 seconds to a php page on the server and the coordi...

C# asp.net use Stream from WebRequest as Response

pretty much...i want to do something like this: Stream Answer = WebResp.GetResponseStream(); Response.OutputStream = Answer; Is this possible? ...

How to use WebRequest to POST some data and read response?

Need to have the server make a POST to an API, how do I add POST values to a WebRequest object and how do I send it and get the response (it will be a string) out? I need to POST TWO values, and sometimes more, I see in these examples where it says string postData = "a string to post"; but how do I let the thing I am POSTing to know tha...

Most efficient way for testing links

I'm currently developping an app that is going through all the files on a server and checking every single hrefs to check wether they are valid or not. Using a WebClient or a HttpWebRequest/HttpWebResponse is kinda overkilling the process because it downloads the whole page each time, which is useless, I only need to check if the link do...

How to Avoid Server Error 414 for Very Long QueryString Values

I had a project that required posting a 2.5 million character QueryString to a web page. The server itself only parsed URI's that were 5,400 characters or less. After trying several different sets of code for WebRequest/WebResponse, WebClient, and Sockets, I finally found the following code that solved my problem: HttpWebRequest webRe...

Why does Http Web Request and IWebProxy work at wierd times

Another question about Web proxy. Here is my code: IWebProxy Proxya = System.Net.WebRequest.GetSystemWebProxy(); Proxya.Credentials = CredentialCache.DefaultNetworkCredentials; HttpWebRequest rqst = (HttpWebRequest)WebRequest.Create(targetServer); rqst.Proxy = Proxya; rqst.Timeout = 5000; try { rqst.GetResponse(); } catch(WebExcep...

WebRequest using SSL

I have the following code to retrieve a file using FTP (which works fine). FtpWebRequest request = (FtpWebRequest)WebRequest.Create(svrPath); request.KeepAlive = true; request.UsePassive = true; request.UseBinary = true; request.Method = WebRequestMethods.Ftp.DownloadFile; ...

Convert HTML Forms to ASP.NET forms with a silent post and response handler

I want to write a DotNetNuke module that can take an HTML form and parse or transform it into an asp.net form that would then do a HTTPPost to the page specified in the HTML Form's action property. We regularly run into the need to use pre-existing forms (from existing sites and Service Providers like Paypal and Constant Contact). Curr...

Using thread in aspx-page making a webrequest

Hi, I kind of new to the hole threading stuff so bare with me here.. I have a aspx-page that takes some input and makes a reqest: HttpWebRequest request = (HttpWebRequest)WebRequest.Create(string.Format("{0}?{1}", strPostPath, strPostData)); request.Method = "GET"; request.Timeout = 5000; // set 5 sec. timeout request.ProtocolVe...

Reading a repeating streaming data source in C#

Hello Everyone, Let's say I have a url to a streaming data source (for example a stream of updated weather data) and I know this url works with GET (I verified that it does return steaming data). The stream is compressed with GZIP, each "message" begins with a 1 byte id, a 2 byte part containing the message length, then another 2...

Why is the Date header not set when I make a WebRequest in C#?

Tonight I started a small project trying to create a C# library to access the Google Storage API. When you create any kind of request to the Google Storage API, you have to include the "Date" header in the web request. I tried to create a WebRequest in C#, and noticed that I couldn't set the "Date" header manually. According to this M...

Connect to Windows app with WebRequest

Is it possible for a windows mobile phone to use WebRequest to connect to a windows client application. I mean an actual windows forms application. I want to use webrequest but the client application cannot be a web app or anything, it has to be a windows forms program. So, is it possible? Thanks ...

Webserver not returning response to webrequest

Following on this question: http://stackoverflow.com/questions/3143075/connect-to-windows-app-with-webrequest , I decided to implement a simple web server type thing on my client app to receive the webrequest's. Basically on the client app I have a listening socket and when it receives a connection it does something with the data and t...

ASP.NET - Interaction with Other Websites

I was wondering if it is even possible to interact with other websites using my own. Here is the scenario: Lets say I have a Lockerz account, which is a place where you do daily tasks to earn points. Once a month you can redeem those points to get prizes such as an ipod, macbook, or other items. I know that sounds rediculous, but stay...

How can I do digest authentication with HttpWebRequest?

Various articles (1, 2) I discovered make this look easy enough: WebRequest request = HttpWebRequest.Create(url); var credentialCache = new CredentialCache(); credentialCache.Add( new Uri(url), // request url "Digest", // authentication type new NetworkCredential("user", "password") // credentials ); request.Credentials = creden...

Problem with this code to test the Credentials?

I wrote this method to test for credentials but I dunno why when it goes to the GetResponse method is actually goes and runs the webservice. I just want it to test if the credentials for that web service are correct or not. private bool TestCredentials(string sURL, ref string sUsername, ref string sPassword) { bool ret...

c# httpwebrequest getResponse() freezes and hangs my program

I was trying to use httpwebrequest to use a rest like service on a remote server and from the first execution itself, my code was hanging the program. Then I tried it as a console application to make sure it has nothing to do with the program itself but no luck! string credentialsJson = @"{""username"":""test"", ...

Trouble accessing GET variables in VBscript

I'm new to VBscript so there is probably a very simple solution to this. Basically, I have my main page with buttons that really just act as links to other pages. In the links I wanted to pass information, so I use the standard ?variable=value like so: <input type="button" name="saveButton" value="Save Systems" onclick="location.href='...

Call an asp.net page (ashx handler) from a different asp.net page

I have a admin page in asp.net that adds data to a database. This database is available as a JSON string to external websites, however, since it's a lot of data, the external websites cache this data locally. I want to be able to ping the external websites to let them know the data has changed so they can referesh their cache. I figure ...

Can I use glib to make some portable http GET request and how ?

Hi there, Was just wondering if any of you already coded a http get request using glib? Is it possible and how ? I just want to call an simple urls with parameters, and the code must be working on gnu/linux, windows and mac. If it is not possible with glib, have you any suggestion about what to use for that purpose (in a portable pers...