<p>Using Restlet I needed to serve some simple static content in the same context as my web service. I've configured the component with a <code>Directory</code>, but in testing, I've found it will only serve 'index.html', everything else results in a 404.</p>

<pre><code>router.attach("/", new Directory(context, new Reference(baseRef, "./content"));
</code></pre>

<p>So... <a href="http://service" rel="nofollow noreferrer">http://service</a> and <a href="http://service/index.html" rel="nofollow noreferrer">http://service/index.html</a> both work, </p>

<p>but <a href="http://service/other.html" rel="nofollow noreferrer">http://service/other.html</a> gives me a 404</p>

<p>Can anyone shed some light on this? I want any file within the ./content directory to be available.</p>

<p>PS: I eventually plan to use a reverse proxy and serve all static content off another web server, but for now I need this to work as is.</p>

Best thing I can think of is to encode it yourself.  How about this subroutine?
```
```
from urllib2 import Request, urlopen
from binascii import b2a_base64

def b64open(url, postdata):
  req = Request(url, b2a_base64(postdata), headers={'Content-Transfer-Encoding': 'base64'})
  return urlopen(req)

conn = b64open("http://www.whatever.com/script.cgi", u"Liberté Égalité Fraternité")
# returns a file-like object
```
```
(Okay, so this code just sends POST-data.  But you apparently want multipart-encoded data, as if you clicked an "Upload File" button, right?  Well, it's a pretty straightforward combination of what I have here and the answers from the question you linked.)