http

Rails : Return a custom HTTP Response

Hi everyone, I'm using a payment module from Paybox. This module is a CGI script that I execute like a shell command with backticks : `#{Rails.root}/public/cgi/modulev3.cgi [params]` This module outputs a complete HTTP response, including headers and body : Content-type: text/html Cache-Control: no-cache, no-store Pragma: no-cache ...

Reading HTTP request headers to decide whether to proceed or not

I'm not awfully knowledgeable about HTTP, but my understanding is that an HTTP request consists of a bunch of headers and then the body. Is it possible for PHP to receive the request headers, make a decision based on what's been received, and then either abort the request or continue to accept the body? This would be useful when receiv...

Difference in sending HTTP status codes from php

what is the difference from setting the responce status in php header("HTTP/1.0 404 Not Found"); and header("Status: 404 Not Found"); What is the difference from the client point of view (aka browser or a client implementation for RESTful WS). I understood that the second one has to do something with CGI. ...

How to pass POST data to the PHP-CGI?

Update: In a fit of desperation, I did the following in a shell: REDIRECT_STATUS=true SCRIPT_FILENAME=/var/www/... REQUEST_METHOD=POST GATEWAY_INTERFACE=CGI/1.1 export REDIRECT_STATUS export SCRIPT_FILENAME export REQUEST_METHOD export GATEWAY_INTERFACE echo "test=1" | php-cgi ...and STILL no $_POST variables are showing up in the ou...

web2py makes no http connection, how does it communicate with browsers

I was trying to sniff HTTP packets though wireshark on my localhost, when i tried working on a web2py instance at my localhost no http connections found. While digging deeper into it i found it is not creating `any connections in the application layer. well then how does it communicate with browsers without http? (I have heard of web2py ...

AppleScript to download files from HTTP server, mutating the URL?

I've never messed with AppleScript so this is only a concept to me. Can this work? Bungie, the game designer, is hosting a ton of PNGs for Halo Reach in systematically named files and directories. IE: http://www.bungie.net/images/reachstats/commendations/onyx/onyx_large_precision_multiplayer.png Change two instances of the same word,...

Can a web server login to external app and pass the cookie to user's browser?

I'm trying to implement single sign-on for a web portal. I've written some code to send a POST request containing the user's login credentials to an external web app to log the user in. (Don't worry, this is all over SSL) The HTTP response from the web app contains a cookie for the user's login. Is it possible for the web portal serve...

Scaling and Serving Images With .NET 3.5

Hi, I am working on a web application where images has to be scaled dynamically and served to the client as fast as possible (with low overhead). I need to create something that scales and compresses high-quality PNGs to medium quality JPEGs. Now, there are multiple ways of doing this and I am slightly confused which method provides th...

[iPhone] MPMoviePlayerController not refreshing or accessing m3u8 on Live HTTP Streaming

I have a Live HTTP Streaming system working on a web server, and I want to see the stream on the iPhone. To achieve that, I instantiate a new MPMoviePlayerController and initialize it with the URL of the .m3u8 playlist, but I'm having some problems: If I try it with an already generated playlist, with the streaming already stopped, I g...

Displaying Web data, not web page, in Android

I need display data from a web page in a ListView, for example if I were to send a request to a time server for the U.S. time zone's times and the web server responded with an HTML web page that contained the current time's of each zone and a small icon image of each geographic region time zone, what steps would I need to take to put tha...

Is it OK to return a HTTP 401 for a non existant resource instead of 404 to prevent information disclosure?

Inspired by a thought while looking at the question "Correct HTTP status code when resource is available but not accessible because of permissions", I will use the same scenario to illustrate my hypothetical question. Imagine I am building a a carpooling web service. Suppose the following GET /api/persons/angela/location retrieves t...

CGI not working with built-in Python 3.1 http.server

I'm using http.server with the CGIHTTPRequestHandler on OS X 10.6 and the posix code path in run_cgi() does not appear to work properly. I'm calling a located at /cgi-bin/test.py from a form submit. For the better part of this afternoon I was receiving the error 'OSError: [Errno 2] No such file or directory' at the os.execve() line 105...

http responses in relation with programming frameworks (java)

Hi, This question came up during working with web services(in java) but I guess could apply in all kind of web applications (http). If an HTTP client sends a POST to a server then, a 202 Accepted has the meaning (according to HTTP protocol) that the POST has been accepted and the request will be eventually processed. Under other conditi...

split HTTP and TCP-only (non-HTTP) traffic

Hi, I have web application that runs on Tomcat (and gets HTTP requests) and some other backend standalone application that gets only TCP. For some reasons, I can use outside only port 8080. So, I need to get all TCP requests (from outside) to port 8080 and forward HTTP ones to web application on Tomcat and all TCP pure requests (that ar...

Is there an Java library for sending binary data over HTTP, HTTP Tunneling?

I would like to send quite large chunks of data in a binary format over HTTP, also called HTTP Tunneling. I would like to use this technique using Java for a few Java Swing applications and maybe an Android application. Is there any good Java libraries for HTTP Tunneling? ...

How reliable is the IP address logged in an Apache access log?

Dear SO, My website is suffering from an apparent bot which GETs a particular URL 5 times within a second, waits exactly 2 minutes, then repeats. The request is coming from the same IP address each time, and I have not observed any malicious payload, so I'm undecided on whether it is some form of spam bot. The User-Agent claims to be IE...

HTTPS Proxy for existing HTTP application

Hi, I have a running HTTP web application and I am facing problems to make it run over HTTPS. I am thinking of bringing some HTTPS Proxy that accepts user requests and forward it to the HTTP web app. What do you think of that? and How can I accomplish that? ...

HttpClient time-out slow under stress

I am using HttpClient 3.1 to connect to a different web services. I have set SO_TIMEOUT and ConnectionTimeout to 3 seconds. I am simulating a service that takes more than 3 seconds to respond. However, actual timeout is much longer, up to few minutes and more. In the end, server is out of memory and stalls. What is going on? Why my conn...

Android: UTF-8 encoded HTTP response to String

Hi I am trying to convert a UTF-8 data to String. The UTF-8 data is obtained by HTTP connection. My problem is the converted String does not display UTF-8 Characters properly. Here is my code {extra bits removed } URLConnection urlconn = url.openConnection(); httpConn = (HttpURLConnection) urlconn; httpConn.connect(); InputStream in= ...

Find websites returning 503 response codes

Hi, Where can I find pages returning 503 codes so I can test a script I'm working on? Thanks ...