http

What's the difference between a URI and a URL?

People talk about URLs and URIs as if they're different things, but they look the same to the naked eye. What's the difference between the two? ...

POST multiple parameters

I am changing a GET to a POST. Currently I have .jsp?id=a,b,c,d. When changing this to a post I am still sitting the id parameter a,b,c,d . This is not working for me. Can I submit a comma separated list to a post parameter? ...

401 when POSTing using HttpWebRequest (yes I used Credentials)

I'm using HttpWebRequest to pull down XML, and POST data back to a 'WebService' and getting a 401 on the POST. When creating the requests I've added Credentials and now tried a credentials cache and setting PreAutenticate to True, still getting the 401! :( Watching the HTTP traffic on the router I set the get make an unauthenticated G...

How can I upload more than one file from a single HTML form in IE?

Internet Explorer (from versions 4 to 7, at least) limits the number of files uploaded using a single 'input type="file"' form field to one. What is the best approach to take if I want to upload more than one file in a single HTTP POST request? ...

HTTP 1.1 Persistent Connections using Sockets in Java

Let's say I have a java program that makes an HTTP request on a server using HTTP 1.1 and doesn't close the connection. I make one request, and read all data returned from the input stream I have bound to the socket. However, upon making a second request, I get no response from the server (or there's a problem with the stream - it doesn...

Ruby: How to post a file via HTTP as multipart/form-data?

I want to do an HTTP POST that looks like an HMTL form posted from a browser. Specifically, post some text fields and a file field. Posting text fields is straightforward, there's an example right there in the net/http rdocs, but I can't figure out how to post a file along with it. Net::HTTP doesn't look like the best idea. curb is loo...

How to use Python to login to a webpage and retrieve cookies for later usage?

Hi! I want to download and parse webpage using python, but to access it I need a couple of cookies set. Therefore I need to login over https to the webpage first. The login moment involves sending two POST params (username, password) to /login.php. During the login request I want to retrieve the cookies from the response header and stor...

What's the equivalent of XMLHTTP from VB6 in C# .Net 2005?

I'm trying to convert some code that worked great in VB, but I can't figure out what objects to use in .Net. Dim oXMLHttp As XMLHTTP oXMLHttp = New XMLHTTP oXMLHttp.open "POST", "https://www.server.com/path", False oXMLHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" oXMLHttp.send requestSt...

Is it possible to add to the available parameters of a request (HttpServletRequest)

I want to intercept a request in a filter/servlet and add a few parameters to it. However, the request does not expose a 'setParameter' method and the parameter map when manipulated throws an error saying it is locked. Is there an alternative I can try? ...

How can I upload files without using an HTML <form>?

Hi, in a web application I am building I need to upload photos without using a form, otherwise it will come up with form embedded in an outer from which is not permitted in XHTML. I think uploading files is what jQuery.post should be able to do, but I currently can't figure out how to do this using jQuery. ...

What are the advantages of using a GET request over a POST request?

Several of my ajax applications in the past have used GET request but now I'm starting to use POST request instead. POST requests seem to be slightly more secure and definitely more url friendly/pretty. Thus, i'm wondering if there is any reason why I should use GET request at all. ...

Does Android WebView need permissions for opening external URLs?

I was trying following example but with external URLs: http://android-developers.blogspot.com/2008/09/using-webviews.html The example shows how to load an HTML file from assets folder (file:// url) and display it in a webview. But when I try it with external URLs (like http://google.com), I am always getting a "Website Not Available"...

GET versus POST in terms of security?

This may be a dumb question, but between a http POST and GET, what are the differences from a security perspective? Is one inherently more secure then another? I realize that POST doesn't expose information on the URL but is there any real value in that or is it just security through obscurity? What is the best practice here? Edit: Over...

What should the HTTP response be when the resource is forbidden but there's an alternate resource?

If I have a resource that a requesting client doesn't have access to but I want to notify them about an alternate resource for which they do have access, should I send them a 403 Forbidden with the alternate resource's URI in the header or content? Or should I just send a 303 See Other redirect to the resource to which they have access? ...

How do I remove a cookie that I've set on someone's computer?

I've got a web system where users log in, and it stores a cookie of their session. When they log in as someone else or log out I want to remove that original cookie that I stored. What's the best way to do that? I'm using Python and Apache, though I suppose the answer will remain the same for most languages. ...

How do you find a free TCP server port using Ruby?

I'm trying to create a use-once HTTP server to handle a single callback and need help with finding a free TCP port in Ruby. This is the skeleton of what I'm doing: require 'socket' t = STDIN.read port = 8081 while s = TCPServer.new('127.0.0.1', port).accept puts s.gets s.print "HTTP/1.1 200/OK\rContent-type: text/plain\r\n\r\n" + t...

What is the simplest way to call an HttpHandler file in .NET?

I have an HttpHandler on my webserver that takes a URL in the form of "https://servername/myhandler?op=get&amp;k=Internal&amp;m=jdahug1". I need to call this URL from my .NET app and capture whatever the output is. Does anyone know how I can do that? I want it to be simple so that I just get back a string with the output, and that I c...

c# (more specifically xna) how can i request a xml file via http? Doesnt need to support xbox.

So im working on a game in XNA and i need it to get a server list off our site. so i just need to do a http request to http://play.feedthezombie.com/?want=servers&amp;enc=xml and get the contest as either a string or xml object. any clues? ...

Large JSP response is truncated :(

I have a JSP accessed through JBoss. It renders a list (a search result). If the response gets big, approximately larger than 200k the response is truncated. I can see how the page just ends in the middle of a tag in Firefox. IE totally freaks out an so does Fiddler. Responses smaller than 200k are no problem. Anyone has experienced thi...

HTTP GET in VBS

Is there a way to perform an HTTP GET request within a Visual Basic script? I need to get the contents of the response from a particular URL for processing. Thanks. ...