http

Returning a bare JSON-string

Hi, i got a webservice and want to return this "string" as a bare string, without the extra serialization by WCF, because it's already serialized... how do i do it? [OperationContract] [FaultContract(typeof(Exception))] [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ...

HTTP 1xx Status Codes

Hi there! Does anyone of you has ever seen a real life occurence of the HTTP "Expect" header? Or any proxy or server answering with a "100 Continue"-Status Message? Do popular HTTP servers like IIS or Apache ever encounter situations where a "100 Continue" is returned? Thanks, Max ...

TCP Vs. Http Benchmark

I am having a Web application sitting on IIS, and talking with [remote]Service-Machine. I am not sure whether to choose TCP or Http, as the main protocol. more details: i will have more than one service\endpoint some of them will be one-way the other will be two-ways the web pages will work infront of the services we are talking about...

Scalable http session management (java, linux)

Is there a best-practice for scalable http session management? Problem space: Shopping cart kind of use case. User shops around the site, eventually checking out; session must be preserved. Multiple data centers Multiple web servers in each data center Java, linux I know there are tons of ways doing that, and I can always come up wi...

Extra "_" parameter in POST request using Chrome.

When I use Google Chrome to make an AJAX POST request I get extra empty parameter "_" on server-side. Here's some background information: Web-server: Python Paste Back-end: Python 2.6/Pylons Browser: Google Chrome 3.0.195.1 JavaScript Library: Prototype 1.6.1 RC3 For example simple: >>print sorted(request.POST.keys()) ['_','my_para...

Adobe air http auth

Hello ! I have a question about HTTP auth in a non browser env. If i have an Air app which takes user/pass to "login" to a web app. THe login action would be done with a request from Air to http://foo.bar/session/create and the uname/pass as POST var. Now i can keep the answer and add it to the headers for my next requests ? If the...

HTML Form works with GET but not with POST

I'm running Firefox 2.0.0.14. I have a form on a webpage which is working fine with the GET method. I'm using a plugin to view my browser's HTTP request when submitting the form, and here it is : GET /postComment.php?review=2&comment=Testing HTTP/1.1 ... However, if I make the simple change from method=GET to method=POST on the form...

How to submit a multipart/form-data HTTP POST request from C#

What is the easiest way to submit an HTTP POST request with a multipart/form-data content type from C#? There has to be a better way than building my own request. The reason I'm asking is to upload photos to Flickr using this api: http://www.flickr.com/services/api/upload.api.html ...

Why is HttpContext.Request.Url not matching what's in the address bar?

Ok, so I want to force https/ssl on parts of my ASP.NET MVC site. Found lots of great sources including an ActionFilter here: http://blog.tylergarlick.com/index.php/2009/07/mvc-redirect-to-http-and-https/ Whenever I enable the ActionFilter however I end up in a redirect loop. The problem is that if I type https://www.mysite.com/ into th...

Check remote file existance with Flex 3

In Flex 3/AS 3, what would be a good way to check if a remote file exists? I'm thinking in PHP ways where you'd try to "fopen" a remote path (like "http://example.com/somefile.exe"), and see if it works or not. I'm not asking to just download all of the file, I just want to know if the file is there (and accessible). ...

Possible to do "relative" Expires HTTP headers?

For example, I want my static files to expire 7 days after they're first downloaded. What should I set the Expires header value to be? ...

How to convert a Net::HTTP response to a certain encoding in Ruby 1.9.1?

I have a Sinatra application (http://analyzethis.espace-technologies.com) that does the following Retrieve an HTML page (via net/http) Create a Nokogiri document from the response.body Extract some info and send it back in the response. The response should be UTF-8 encoded So I came to the problem while trying to read sites that use...

What's the maximum number of HTTP connections I can have open in one Windows Server 2008 box?

I have a web server hosting an HTTP chat application that works with long-polling. This means a client browser "polls" for new info and the server does not respond until there is info to send back, so the HTTP connection is left open for a long time, up to a minute. My question is how many of these connections the server can handle ope...

JMeter versus The Grinder?

I'm looking at stress testing our website and having trouble picking the right tool. It looks to me like two of the most popular are JMeter and The Grinder. Can anyone help with reasons in favor of either? Thanks! ...

serving up a png file via ifstream

This seems like a really simple task, so bear with me. I'm trying to extend a server which serves up files and webpages. Currently the server gets an HTTP request, parses it, and calls a function called sendFile: void sendFile(ostream& ostr, std::string filename) { std::ifstream ifs(filename.c_str(), std::ios_base::binary); os...

Determine supported HTTP version by the web server

Hi, Is there a way to check whether a web server supports HTTP 1.0 or 1.1? If so, how is this done? Thanks, Kenneth ...

What's the packet-level difference between an XMLHttpRequest and a regular HTTP request?

I'm wondering: if I were a a router, packet inspector, firewall, or other packet-sniffing device (which I'm glad I'm not) would I be able to tell the difference between a traditional HTTP request and an XMLHttpRequest? Less theoretically, is it possible that some ISP or (let's say) cell phone data provider could restrict XMLHttpRequest t...

Intermittently incomplete response using Apache HttpClient 3.0.1

I am stumped about this, so I thought I'd ask in case any of you have come across it, since HttpClient development is a little bit of an art. The problem I am facing is this: An application is using the Apache HttpClient Java library to communicate to a server in the same company network. Most of the time it works without a problem, bu...

If an externally included file (e.g. JavaScript or CSS) is included twice (or more) on a page will there be two (or more) web requests?

Let's say because of a conditional comment or just being careless the same included file is present for users of some browser or even all browsers. For example: <!--[if lte IE 8]> <script src="mygreatincludefile.js" type="text/javascript"></script> <![endif]--> <!--[if lte IE 6]> <script src="mygreatincludefile.js" type="text...

how to enable Last-Modified header for static resources served by Google App Engine (Java version)?

Is there a way to turn on the Last-Modified header for static resources served up by Google App Engine? I have a large zip file that my app serves up to an iPhone client app, and I'd like to only download it if the Last-Modified date indicates that it is newer than the cached copy on the iPhone. PS: I am using the Java version of Goog...