http

Java http call returning response code: 501

I am having an issue with this error: **Server returned HTTP response code: 501 for URL: http://dev1:8080/data/xml/01423_01.xml** See this code: private static Map sendRequest(String hostName, String serviceName) throws Exception { Map assets = null; HttpURLConnection connection = null; Authenticator.se...

How to disable transfer-encoding:chunked websphere

We have a webservice running on Websphere 6.1 using the IBM JAX-RPC based webservices. Client is sending requests without HTTP header of transfer-encoding:chunked (They specify content-length). The response from websphere always has transfer-encoding:chunked in the HTTP header. I assume this will result in the response being sent in mult...

PHP - How to start a session after HTTP authentication.

I am dealing with the skeleton of an old website that uses http authentication for users to access membership data. The access content button is a link to a index.html page with the following: <meta http-equiv="REFRESH" content="0; url=http://www.example.com/something.php"&gt; I would like to change this to a index.php page which woul...

Python CGI returning an http status code, such as 403?

Hi, How can my python cgi return a specific http status code, such as 403 or 418? I tried the obvious (print "Status:403 Forbidden") but it doesn't work. ...

C# HTTP programming

Hello there, i want to build a piece of software that will process some html forms, the software will be a kind of bot that will process some forms on my website automatically. Is there anyone who can give me some basic steps how to do this job...Any tutorials, samples, books or whatever can help me. Can some of you post an working c...

Is it necessary to set the Content-Length in my response header?

I'm reviewing some legacy code and I've found a bug that causes the response to sit indefinitely. Here's the basic idea: Response.Content-Type = "application/octet-stream" Response.AddHeader("Content-Disposition", "attachment; filename" & someFileName) Response.AddHeader("Content-Length", someStoredLength) Response.BinaryWrite(someByte...

How does the Six Apart Update Stream work?

Six Apart has this neat service that streams out LiveJournal, Vox, etc. updates: http://www.sixapart.com/labs/update/developers/ It also has the interesting ability to know if the client has missed parts of the feed. I've tinkered with writing a similar service for myself, and while I've gotten it to stream okay, I'm ashamed to admit ...

Detecting the http request type (GET, HEAD, etc) from a python cgi

Hi, How can I find out the http request my python cgi received? I need different behaviors for HEAD and GET. Thanks! ...

HTTP Authentication for iPhone

Probably Duplicate of Basic HTTP Authentication on iPhone HttpBasicAuthentication in IPhone i want to write an http authentication program for iphone. should i do it using soap request or NSURLConnection? Please give me one good link where i can get help how to do it step by step , Regards, ...

Post file using ruby's Http class

I have been learning to fake posting forms using Ruby's Http class, but now I need to post a file (as in faking a form submission where one of the fields is input type="file"). Anyone know how to do this? NB It's not essential I use the Http class, just that I can post files. ...

Long polling issue with high traffic website

Say I have script, that does long polling on server to check if user has any new mesages. Server side would be something like this while counter < 5 if something_changed push_changes_to_client break else counter++ sleep 5 Which checks database 5 times and every time if there is no change, it wai...

Google Protocol Buffers and HTTP

Hello, I'm refactoring legacy C++ system to SOA using gSoap. We have some performance issues (very big XMLs) so my lead asked me to take a look at protocol buffers. I did, and it looks very cool (We need C++ and Java support). However protocol buffers are solution just for serialization and now I need to send it to Java front-end. What s...

What's the best way to handle spammers sending unwanted POST data?

My Ruby on Rails blog application is getting a lot of comment spam for a particular blog post even though comments are closed and the comment form is no longer there. The comments are filtered by Akismet so they're not visible, but I'm not sure how my app should best respond to these requests. I thought about simply redirecting to the p...

Incrementing resource counter in a RESTful way: PUT vs POST

I have a resource that has a counter. For the sake of example, let's call the resource profile, and the counter is the number of views for that profile. Per the REST wiki, PUT requests should be used for resource creation or modification, and should be idempotent. That combination is fine if I'm updating, say, the profile's name, becaus...

Is it possible to alias a filename on an apache webserver?

Hi, I would like to make e.g. www.address.com/u.exe equal to www.address.com/serverfile.php or pl? Is it possible? So if someone types www.address.com/u.exe should get servefile.php... Thanks for showing the right direction.. This seems to work. RewriteEngine on also had to be added. I had to change .htaccess file RewriteEngine on ...

Can a PHP script continue running after ending the HTTP request?

How do I write a PHP script that continues running, even after flushing out some text and ending the HTTP request? Is this possible? ...

Can a PHP script abort itself or detect abortion?

PHP scripts can continue executing after the HTTP page request, so how do I finally stop it executing when I'm done with it? Also, is there an event to detect when the OS is going to forcibly abort the script? or how do I keep an internal timer to predict max_execution_time? ...

Perform a simple HTTP request using C++ / Boost via a proxy?

I'm quite a newbie with Boost, and my only experience of surfing though a proxy using a library is using .NET (that is really convenient for that purpose). I'm now trying to perform a simple HTTP request through a HTTP proxy. Is there a tidy way to do it using boost directly? My proxy use a NTLM authentification. ...

Using Darren Johnstone's Large File Upload Library with ASP.NET MVC Controllers

Darren Johnstone wrote a comprehensive server control and library to upload large files with a progress bar in ASP.NET. I would like to use it with ASP.NET MVC, using a controller method to receive the file, and an Ajax controller method to drive the status bar. I have studied the classes, but am having difficulty getting my mind aroun...

C# code for saving an entire web page? (with images/formatting)

Hi, I've been struggling to find an exmample of some C# code (I'm using C# Visual Studio 2008 express) that can programmatically save an entire web page (given a URL) including the images and formatting (e.g. CSS). The intension is that in a subsequent I'd ship this off (not sure how yet) so it could be view later via a browser. Does ...