philihp.com

Tag: HTTP

Sending HTTP Requests without Reloading and without AJAX

Supposing I have a simple HTML form that looks like this: <form method=”post” action=”/SomeServlet”> <input type=”text” name=”message” value=”Hello Server” /> <input type=”submit” value=”Send” /> </form> And supposing I have a Servlet mapped at the path /SomeServlet, consisting of the code: public class SomeServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException [...]

Enable mod_userdir for Apache2 on Ubuntu 8.10

To enable mod_userdir, so your server’s Apache httpd server will respond to requests like “http://www.yourserver.com/~someuser”, use the a2enmod command, then restart Apache to pickup the change: sudo a2enmod userdir sudo /etc/init.d/apache2 restart

.htaccess mod_rewrite Redirect Root / path to /blog directory

I’ve just setup an HTTP Redirect from www.philihp.com to www.philihp.com/blog. This makes it so people don’t see my ugly project listing when they come here, they go right to the blog. I still wanted people to be able to go to the root path, though, because a lot of times whenever I put some small [...]

Using WGET with HTTP GET Parameters

WGET is a simple tool that is usually on a lot of shell boxes. I think it might be installed by default on Linux. Sometimes you have to get it installed by your admin. At any rate, it’s useful for downloading a resource from a simple web service like so: WGET http://www.asdf.com/jkl.html You can even [...]

Turning HTTP Chunking off with PHP

When I set the Content-Length HTTP header, the response from the server does not include any HTTP chunking. This may be useful. I am using PHP/4.4.7.

Two notes about RESTful services

In RESTful protocols, HTTP methods correspond to actions on a resource. Most commonly the four HTTP methods PUT, GET, POST, and DELETE are used to implement CRUD actions. PUT vs. POST People often mistakenly equate POST with Update and PUT with Create. For an exact definition, check the HTTP 1.1 RFC, but generally speaking… PUT [...]