http

How does YouTube prevent video content from being saved/redistributed?

Sure, you can embed a YouTube video on any site, but the content ultimately must come from their server. What technology(ies) do they have that prevents us from saving/redistributing content? From a protocol standpoint, you would think that anything that comes over the wire could be saved. I hope I am not the only guy on Earth who doe...

Random characters on an HTTP response using sockets.

I am using sockets to create a POST request to a given server. The response comes back mostly ok, and I'm using an InputStream with an encoding of "UTF-8" to read the response from the server. Most of the response makes sense and I'm able to view the HTML correctly, however, seemingly at random, I see codes such as "1ffa", "6e8", "1972",...

What is the difference between HTTP_X_FORWARDED_FOR and HTTP_FORWARDED

I have been looking for a way to find the IP Address of the client and I've found both of these HTTP Headers. From what I've found they are the same thing, but HTTP_X_FORWARDED_FOR seems more widely used. Do any of you know what the difference is and if I am going to have to check both of these? Thanks. ...

Is it possible to retrieve website source code for parsing in an iPhone app?

I'm making an application that directly takes images from a site and downloads them into the apps Documents directory for use when the user doesn't have a data connection. The application will check the site for the latest post and update accordingly. I've never done anything with databases before and thought that this would be easier t...

Is the UserHostAddress changed when using an F5 load balancer?

We are using a F5 load balancer for our servers. Our VB code is checking the UserHostAddress using HttpContext.Current.Request.UserHostAddress. My question is, will this value return the IP from the load balancer, or does it still have the client IP address? I will post this on ServerFault as well in case this is more of a server is...

FAPWS: Form with File Upload and parameters. Help parse the raw input?

I have a form that is multi-part for file upload, but it also has some other parameters like username, password, etc. Here's what the HTML form looks like: http://pastebin.com/AjmGsQBu And here's my python code to handle it: http://pastebin.com/kj1PBYmH I've verified with Charles that all the parameters are being submitted, they're ju...

how do I get apache http client 4.0.1 (org.apache.httpcomponents) to redirect automatically to a get after a post?

According to the documentation, the apache http client is supposed to automatically redirect. I am submitting a post to a server, and it has a redirect. Unfortunately, the response handler is giving back an empty string. It just isn't following the redirect and giving me that content directly. Is there an easy way to get the client to fo...

Unable to View Source of an XML file using IE8

i have a web-page that returns XML with an xsl stylesheet transform, e.g.: <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type='text/xsl' href='/css/homepage.xsl'?> <MyData> ... </MyData> It properly displays the transformed XSL as HTML. But when i try to view the XML source, Internet Explorer gives me the error: The X...

How does a (full featured) long polling server work abstractly

Since you're using an event loop as opposed to threads, how does the actual server look? I know it uses an event loop, but how do you separate out the requests? And how do you prevent your server from running extremely slowly (since it, I assume, can only push one thing at a time since it's threadless?) Some sort of pseudo-code would b...

HTTP interface for Android application

Hi: I want to implement a http remote control for an Android application: From a browser on a computer in the local area network the application running on the Android device should be controlled. Are there any recommendation how to implement this? I heard about i-jetty but it is not uncomplex to integrate it into an existing app. ...

Is there some http GET response that I can add to fix an encoding problem on the client web browser?

I have an embedded web server written in C using uIP libraries, in a microcontroller, which outputs the following static text in response to an http get. It is shown below as a C literal string: "HTTP/1.0 200 OK\r\n" "Server: UIP/1.0 (http://www.something.com/)\r\n" "Content-type: text\html\r\n" Right after that comes the doctype stri...

Android Development Image Upload Corrupted

I'm developing an android application and I'm trying to upload an image to our server from the client side. When I get onto the server to view the image it is corrupted (gray bar on bottom) sometimes. I'm not sure why this is happening. If anyone can shed some light on this issue that would be greatly appreciated. Here is the code that u...

why does response codes returned by httplib and urllib not match?

I'm writing a dead link detector and wondering which lib i should use, httplib and urllib, so I tried both. def http_response_code(url): host = urlparse(url)[1] req = '/'.join(urlparse(url)[2:5]) conn = httplib.HTTPConnection(host) conn.request('HEAD', req) res = conn.getresponse() return res.status, res.reason ...

how to send data from android to server

hi expert, I'm exploring to scan ssid and rssi from android and I'm able to do it, but now i have want send the data to the server, so i explore i found below code HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://101.34.45.45/rawData"); try { List<NameValuePair> nameValuePai...

Effective way of doing http queries to a server on Java

I'm working on a software that does extensive queries to a database which is has a http interface. So my program parses and handles queries that are in form of long http:// addresses.. I have realized that the bottleneck of this whole system is the querying and the data transfer barely goes above 20KB/s even though I am sitting in the ...

Correct Redirected HTTP GET retrieval

Hi, I'd like to know how to do a HTTP GET request to a server from which I know I will get redirected at least a couple of times... I'd like to get the response (body) of the "last" webpage. It should come up with a code in my specific example... Or, as an alternative, I do know you can start the browser from within your Android app, is...

A web application as a logging frontend for Ruby

Hi, I was looking for a web application that hopefully catches log messages sent from Ruby programs and display them , much like the Chainsaw program (in integration with log4r). I tried to Google anything related but with no success so far. Does anybody have a suggestion ? Thanks in advance. ...

http file upload Objective C

I'm trying to upload an image file to a http server. Here's the code fragment NSData *imgData = UIImagePNGRepresentation(img); NSString *post = [NSString stringWithFormat:@"&UserID=%@&Query=%@&fileContent=", userID, @"putImage"]; NSMutableData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; [p...

How should I handle unsupported verbs on a resource?

I am developing a RESTful framework and am deciding how to handle an unsupported verb being called against a resource. For example, someone trying to PUT to a read-only resource. My initial thought was a 404 error, but the error is not that the resource cannot be found, it exists, just the user is trying to use the resource incorrectly....

why do we need to store sessions in a database sometimes?

I was told that one common reason of storing sessions in a database is to make it cross-server. But isn't a TCP connection persistent until one closes the browser? Why the next request may switch a different server? ...