# HttpServer, problems setting mime type

**URL:** https://discourse.julialang.org/t/httpserver-problems-setting-mime-type/4162
**Category:** New to Julia
**Tags:** question
**Created:** [June 8, 2017, 2:12pm UTC](https://discourse.julialang.org/t/httpserver-problems-setting-mime-type/4162 "2017-06-08T14:12:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![TravisA9](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/travisa9/32/357_2.png) [@TravisA9](https://discourse.julialang.org/u/TravisA9)
#### Post date: [June 8, 2017, 2:12pm UTC](https://discourse.julialang.org/t/httpserver-problems-setting-mime-type/4162/1 "2017-06-08T14:12:34Z")

</div>

I’m new to HttpServer.jl . I am starting out by modifying one of the examples which works fine -of course- but when I insert links to other files (specifically css, in this case) they’re sent with the wrong MIME type. I thought it was going to be easy to fix. I did the following:

(1) Test each requested file for the type and save that to a variable.  
(2) `mime = mimetypes[type]`  
(3) ` res.headers["Content-Type"] = mime`  
(4) And even ` req.headers["Content-Type"] = mime` …just because.

I print out the Content-Type and it is being set to `text/css` but the browser complains saying that the css files are sent with the text/html mime and so even though they arrive the page does not render properly because the styles are not applied.

I would appreciate any help I can get, thanks!

---

<div class="post-metadata">

### Author: ![TravisA9](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/travisa9/32/357_2.png) [@TravisA9](https://discourse.julialang.org/u/TravisA9)
#### Post date: [June 8, 2017, 3:29pm UTC](https://discourse.julialang.org/t/httpserver-problems-setting-mime-type/4162/2 "2017-06-08T15:29:47Z")

</div>

**Awesome!** …it’s working now.

I was digging through the HttpServer source files and found the following line of code:

```julia
        Response(200, Dict{AbstractString,AbstractString}([("Content-Type",mime)]), s)

```

This helped me to understand it a bit better.

 ![](https://global.discourse-cdn.com/julialang/original/3X/6/0/60534427d25bcca9ca8e72dc0a160e019837e16b.png)
