http

How to stream partial content with ASP.NET MVC FileStreamResult

We're using a FileStreamResult to provide video data to a Silverlight MediaElement based video player: public ActionResult Preview(Guid id) { return new FileStreamResult( Services.AssetStore.GetStream(id, ContentType.Preview), "application/octet-stream"); } Unfortunately, the Silverlight video player downloads the ...

XMLHttpRequest, basic authentication and expiring password

I use XMLHttpRequest and basic-auth to access application interface. Password is temorary and is generated by other request, so it expires after some time. But browser (Firefox least) keep using old one, failing and showing login popup. If i suppress popup by returning 403 for requests with X-Requested-By and wrong password, mozilla nev...

http redirection issue

Hello everyone, As far as I know, we can use two method to redirects http response. Using Java script window.location; Using HttpContext.Current.Response.Redirect in ASP.Net From function and end user perspective, are the two methods interchangeable? thanks in advance, George ...

How to connect a webserver

how to connect and retrive data from one webserver through coding in android application? How to achieve this ? Give me sample code for this ...

Request methods on https-server

Hey everyone, I don't know whether my title is correctly articulated, but I have following problem: I have a self-written Java webserver, that handles incoming client requests. It works fine with all the request methods (GET, POST, HEAD, OPTIONS, DELETE, ...). It also works fine with sending files and stuff when I use http. GET and POST...

Looking for HTTP Authentication website examples

Hi, I am looking for a website that requires HTTP authentication, so I can observe the behaviour of typical HTTP authentication dialog boxes. The reason I am looking into this, is that for some reason, on Firefox 3, our Flex app seems to open another HTTP authentication dialog box again, after cancel is clicked. It only seems to happen i...

WebException when reading a WebException's response stream

I'm communicating with a web server from .Net. The web server throws a 500 internal server error and writes a detailed error message. I'm trying to read the error message that is received from a web exception, but getting another web exception. Why is the second WebException thrown? try { var webResponse = (HttpWebResponse)webRequest...

Is it inadvisable to use http traffic analysis to build a meta web service / pseudo-api?

I've been looking at http traffic analyzers which are browser addons that monitor and analyze all incoming and outgoing HTTP traffic between the browser and whatever web server you're connecting to. The types of information available per request include: * Request and response headers * Sent and received cookies * Querystring parameter...

How do I get urllib2 to log ALL transferred bytes

I'm writing a web-app that uses several 3rd party web APIs, and I want to keep track of the low level request and responses for ad-hock analysis. So I'm looking for a recipe that will get Python's urllib2 to log all bytes transferred via HTTP. Maybe a sub-classed Handler? ...

How do I configure apache httpcore 4 to use a proxy?

I'm trying to use the latest (4.0.1) Apache http core components library. However, my web browser goes through a proxy - suppose it is myproxy.com:9191. Could someone provide some sample code for getting a simple http get to use this as a proxy? I've tried adding the following at the beginning of my code, but had no joy: ProxySelector....

Writing a "raw" HTTP client in C#

I am trying to write a "raw" HTTP client in C#. You may ask why?? My aim is to implement an HTTP client in J2ME (which can only do GET and limited POST), but first I need to understand the HTTP protocol better (hence the C# attempt). My first attempts are failing: var requestBytes = Encoding.UTF8.GetBytes(@"GET / HTTP/1.1 User-Agent:...

Shared Secret Key Length

I'm trying to create an authenticated HTTP service endpoint by using shared secret. A good example is Flickr signing scheme. I'd like to know what is the best public key and secret key length? I'm almost sure people will say arbitrary, but would like to know what are the general opinion and why. Another question, Flickr uses MD5 to ge...

How to change only the protocol part of a java.net.URL object?

I have a java.net.URL object that uses the HTTPS protocol, e.g.: https://www.bla.com And I have to change only the protocol part of this URL object so that when I call it's toString() method I get this: http://www.bla.com What is the best way to do that? ...

Strange website navigation mechanism

I am performing UAT on someone else's web-based application. the system is quite large with tens of forms, and hundreds of seperate input fields. Overall it seems well built and usable. I have noticed one thing that seems very strange to me. Every link I click on actually performs a POST request (containing details of the page I want) t...

Measuring the HTTP response time back to the client using only the server

I need to measure how long it takes to send a web response to a client - from the server-side only. I know there are ajaxian and client-side ways of doing this but I am limited to a server-side only way of measuring the time to the client. Is it possible to roughly approximate this using the ACK sent back from the client browser after t...

Validate Origin of FORM POST to ensure it came from same server/app

I want find a platform/language agnostic solution to ensuring the origin of a FORM POST is from an expected source. I.e. Page1.aspx posting to Page2.php within the same web site. Specifically what I am attempting to do here is to prevent request forgery. ...

How do I create a chat server that is not driven by polling?

I have created a simple chat server that is driven by client polling. Clients send requests for data every few seconds, and get handed any new messages as well as information about whether their peer is still connected. Since the client is running on a mobile platform (iPhone), I've been looking for ways of getting rid of the polling, w...

mod_rewrite not working as internal proxy

I have a site that needs to use mod_rewrite to direct traffic to www.example.com to 123.45.67.89, port 8080, through an internal proxy. This is the rewrite rule I'm using: RewriteEngine On RewriteRule ^(.*)$ http://123.45.67.89:8080/$1 [P] When I visit www.example.com/myurl, I receive the following error with a 404: The requeste...

How can I select and upload multiple files with HTML and PHP, using HTTP POST?

I have experience doing this with single file uploads using <input type="file">. However, I am having trouble doing uploading more than one at a time. For example, I'd like to be able to select a series of images, then upload them to the server, all at once. It would be great to use a single file input control, if possible. Does anyo...

Will proxies cache HTTP Responses when authentication is provided?

Given a URI which has headers for caching properly configured. If two users make a request to the same URI but provide two different sets of credentials, will a proxy cache the response per user+URI, or per URI, or not at all? ...