Yeah found a whole file of MIME types:
https://github.com/JuliaLang/HttpCommon.jl/blob/master/src/mimetypes.jl
type Response
status::Int
headers::Headers
data::HttpData
finished::Bool
end
Response(s::Int, h::Headers, d::HttpData) = Response(s, h, d, false)
Response(s::Int, h::Headers) = Response(s, h, "", false)
Response(s::Int, d::HttpData) = Response(s, headers(), d, false)
Response(d::HttpData, h::Headers) = Response(200, h, d, false)
Response(d::HttpData) = Response(200, headers(), d,false)
Response(s::Int) = Response(s, headers(), "", false)
Response() = Response(200)
headers() = (String => String)[ "Server" => "Julia/$VERSION",
"Content-Type" => "text/html; charset=utf-8",
"Content-Language" => "en",
"Date" => RFC1123_datetime()]
Not worked with servers a lot so am unsure which MIME to choose and how to
switch to it.
Den måndagen den 10:e februari 2014 kl. 23:17:22 UTC+1 skrev John Myles
White:
>
> Can you control the HTTP request return MIME type? At one point I believe
> (but am not sure) that HttpServer always returned HTML as the MIME type.
>
> -- John
>
> On Feb 10, 2014, at 11:06 AM, Marcus Appelros
> <[email protected]<javascript:>>
> wrote:
>
> > Trying to setup a server that makes files in a folder available for
> download.
> >
> > Html files can be loaded by the server and accessed (+javascript
> interaction) via localhost:8000, the html file displaying a image works
> when viewed directly in firefox, the image is in the same folder (named
> html) and this is also where julia is run from.
> >
> > No image is displayed, when changing to a link something tiny unopenable
> can be downloaded of varying size.
> >
> > Modified the server to run `dir` on connection, at first the result
> displayed in terminal which showed the html folder, however when the result
> is sent to the client via Response(readall(`dir`)) the result shows the
> root directory.
> >
> > http://localhost:8000/home/ shows a list of user accounts and the image
> is present in the output from http://localhost:8000/home/quin/html
> >
> > Have tried various combinations of link paths while copying the image
> all over the computer to no avail, any help is much appreciated.
>
>