# How to serve a file with specific MIME / media type in Genie?

**URL:** https://discourse.julialang.org/t/how-to-serve-a-file-with-specific-mime-media-type-in-genie/71447
**Category:** Web Stack
**Tags:** question, first-steps, genie, http
**Created:** [November 14, 2021, 6:59am UTC](https://discourse.julialang.org/t/how-to-serve-a-file-with-specific-mime-media-type-in-genie/71447 "2021-11-14T06:59:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ProvocaTeach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/provocateach/32/30788_2.png) [@ProvocaTeach](https://discourse.julialang.org/u/ProvocaTeach)
#### Post date: [November 14, 2021, 6:59am UTC](https://discourse.julialang.org/t/how-to-serve-a-file-with-specific-mime-media-type-in-genie/71447/1 "2021-11-14T06:59:30Z")

</div>

Hi all,

I am still new to the Julia web stack – namely, the Genie and HTTP packages.

I know that it is possible to serve an HTML file with [media type](https://www.iana.org/assignments/media-types/media-types.xhtml) `text/html` from, say, the root directory `/` using:

```julia
route("/") do
  serve_static_file("index.html")
end

```

Here are my questions:

- How does Genie know which media type to serve the file with? Is it auto-detected from the file extension `.html` or is it some other process?

- Suppose I want to serve a file called `data.trig` with the media type `application/trig` on the route `/data`. Or, more generally, any HTTP response where I have modified the response headers and body to my liking. What is the proper way to go about this?

(I am still new to the Julia web stack, so any resources on how to modify response headers in Genie.jl or HTTP.jl would be welcome also.)

Thanks in advance!
