Building A RESTful PHP Server: Understanding the Request

Once upon a time, what seems like a lifetime ago, I was away for a couple of weeks, and I wrote a series of posts about serving RESTful APIs from PHP to keep my blog going while I was away. Fast forward a few years and those posts are outdated and still wildly popular – so I thought it was about time I revisited this and showed how I’m writing RESTful PHP servers today!

In the first part of this (probably) 3-part series, we’ll begin with the basics. It might seem boring, but the most important thing to get right with REST is parsing all the various elements of the HTTP request and responding accordingly. I’ve put in code samples from from a small-scale toy project I created to make me think about the steps involved (should I put the code somewhere so you can see it? Let me know). Without further ado, let’s dive in and begin by sending all requests through one bootstrap script: Continue reading

Which Basket Should A Developer Put Their Eggs In?

The situation goes like this. Lots of excellent, capable people have great ideas for new software products. They are bootstrapping their venture, so they look for a developer who wants to give some time up front and receive a fair (let’s assume fair) share of the rewards once the product becomes successful.

The question is: as a developer, how do you know which of these products (I get about one tempting enquiry a month from what sounds like a real person who isn’t building a social network) is a good bet?

Using lrnja.net Custom URL Shortener with Bit.ly

I’m a big bit.ly fan and recently I registered a shorter URL to use for short links – and I went for lrnja.net. I sat down to configure my new domain with bit.ly, and it was very straightforward (I’d almost say “designer-proof”! /me ducks).

  • First: register your domain
  • Log in to your registrar’s control panel and add an A record*
  • That’s it! In about 24 hours, you’ll be able to shorten with your domain

* or a CNAME if you want to use a subdomain of an existing domain.

Bit.ly has excellent instructions here: lrnja.net/bitlydomain