http

NSURLRequest - encode url for NSURLRequest POST Body (iPhone objective-C)

I am sending a post using NSURLRequest. NSURL *url = [NSURL URLWithString:someUrlString]; NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url]; NSString *msgLength = [NSString stringWithFormat:@"%d", [parameterString length]]; [theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"]; [theRequest setHT...

What is a multipart HTTP POST and how to make it? (scribd)

Hi. I'm trying to upload a file to scribd. It says: "The contents of the file to upload. This needs to be expressed as part of a multi-part HTTP POST".. Anyone know what they mean about this? It should look something like this: http://api.scribd.com/api?method=docs.upload&file=THE MULTIPART-HTTP-POST&api_key=API-KEY ? Thank a lot,...

Turning on debug output for python 3 urllib

In python 2, it was possible to get debug output from urllib by doing import httplib import urllib httplib.HTTPConnection.debuglevel = 1 response = urllib.urlopen('http://example.com').read() However, in python 3 it looks like this has been moved to http.client.HTTPConnection.set_debuglevel(level). However, I'm using urllib not http....

How to implement a single sign-on authentication server?

Hi all, I want to implement a discrete remote authentication server that handles login for many sites. Somewhat similar to OpenID. Basically, I have site-1 and site-2 and they're both reliant on the same user database, which is on a separate auth-site. So, auth-site handles user authentication for them, and during this process, makes i...

Examine http response headers in IE8

I'm looking for an ie8-addon that displays the http headers like firebug or httpliveheaders do. Any advice is appreciated. edit: I may be blind but it seems as if the built-in developer tools (F12) do not show the http headers. ...

What HTTP framework to use for simple but scalable app?

What HTTP framework should I use for a simple application with implied scalability, priferable Pythonic? I would like to be able to smoothly add new features to my app when it has already been deployed. ...

How to flush HttpListener response stream?

HttpListener gives you response stream, but calling flush means nothing (and from sources it's clear, because it's actually doing nothing). Digging inside HTTP API shows that this is a limitation of HttpListener itself. Anyone knows exactly how to flush response stream of HttpListener (may be with reflection or additional P/Invokes)? U...

Disable all default HTTP error response content in Tomcat

By default, Tomcat sends some HTML content back to the client if it encounters something like an HTTP 404. I know that via web.xml an <error-page> can be configured to customize this content. However, I'd just like for Tomcat to not send anything in terms of response content (I'd still like the status code, of course). Is there any way ...

same page, different urls. redirect?

Say that I have an article with multiple pages. Each page has a short title for in the URL (wordpress calls them post slugs). If this title is not given in the URL, the first page is shown, so example.com/myarticle is the same page as example.com/myarticle/firstpage. The question is: Should I redirect the former to the latter? And if so...

How to Test ASP.NET Application That Depends on IP Address

I have written an ASP.NET application, and in this application I log the request IP address. And I also serve different content according to different IP range. My question is, in my limited test environment, I only have 5 machines, each machine has only 1 IP address, I want to test fully about the function of my IP address based ASP.NE...

How to turn a Ruby Hash into HTTP Params

That is pretty easy with a plain hash like {:a => "a", :b => "b"} which would translate into "a=a&b=b" but what do you do with something more complex like {:a => "a", :b => ["c", "d", "e"]} which should translate in "a=a&b[0]=c&b[1]=d&b[2]=e" or even worse, with something like: {:a => "a", :b => [{:c => "c", :d => "d"},...

Better File Uploading Approach - HTTP Post Multipart vs HTTP Put?

Situation - Upload a simple image file to a server, which clients could later retrieve 1) Designate a FTP Server for the job. 2) HTTP Put - It can directly upload files to a server without the need of a server side component to handle the bytestream. 3) HTTP Post - handle the bytestream by the server side component. (in...

barebones minimal example: using XUL to http POST

I am trying to figure out if XUL is a good candidate for GUI forms in intranet apps. It's been difficult to find anyone who actually uses it though. Therefore I thought I'd ask for a hello world style example. Suppose I have a php page that does nothing but display any content sent to it via HTTP POST. (e.g., http://mysite.com/postdump...

Mjpeg VLC and HTTP Streaming

Hello guys, I'm generating a MJpeg Stream and trying to stream it to VLC and play it there. The code: public void SendMultiPartData(String contentType, Func<byte[]> getData) { MemoryStream mem = null; response.StatusCode = 200; for ( byte[] buffer = getData(); buffer != null && buffer.Length > 0; buf...

Making sure http appears in a web address

I have people posting their website address but variations are posted such as: theirsite.com www.theirsite.com http://theirsite.com http://www.theirsite.com When I link to an address without http:// it takes the link as internal <a href="theirsite.com">their site</a> sending people to something like: http://mysite.com/thiersite.co...

Need to override Http Response Code from asmx web service

My web sevices support flex/flash clients and, upon unhandeld exceptions, throw custom faults that extend System.ServiceModel.FaultException. I have been informed that flex/flash can't read these custom faults if the the http response code is different from 200. This is documented as flex/flash bug: http://bugs.adobe.com/jira/browse/SD...

Clearing session on one page

I have two pages, and both repopulate the fields of the page with what the user enters as the user navigates back and forth from the pages. Is there any way to clear the field of just one page. I was looking at the .invalidate method... ...

iPhone + Sharepoint

Hey, is there a way to connect the iPhone with Sharepoint? I wonder, if it is possible to implement the HTTP or WEBDAV protocol of Sharepoint in Cocoa/Objective-C. Regards ...

How to keep link alive on mongoose web server

I try to use keep-alive connection mongoose, but it seems mongoose close the connection first. I changed the embed.c to send back the connection: keep-alive. The connection is still closed after response. border@ubuntu:~$ nc 127.0.0.1 9999 GET /test_get_request_info HTTP/1.1 Connection: keep-alive HTTP/1.1 200 OK Content-Type: text/pl...

Can you make http client connections from a web app(flash, java)?

Before I jump both feet in and waste my time learning something that I can't use for my needs, I have to ask: Can I make a http connection to another website from within a java applet or a flash file? Say I have a java applet that wants to load results from google. Will the JVM give me access to such a call? What about Flash? I've read...