Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I usually end up using POST for all CREATES, since I find no good way to pregenerate the URI to the thing I'm creating. Say you have a resource /videos which is the root to a listing of all the videos in your system. Each individual video might have a URI like /video/100, /video/110, etc. But if I want to create a new video using put I have to PUT the file to something like /video/120 but how do I know it's 120? Usually this ends up being autogenerated by a database anyway. So I find it most easy to POST to /video and the HTTP response is a redirect to the newly created resource. I'm curious how you might get around this problem?
    Waiting on the Road to Eventually, I lost my Place On Line
    • From what I've read the common thing to do is PUT to the 'collection' URI -- in your case, you'd do 'PUT /videos'; the server would return a '201 Created' header with the URI of the resource you just uploaded, like: '/video/110'.