I want to store MIME type of the response obtained from GET request. I have used the DetectContentType
function but it gives me text/plain; charset=utf-8
for both js and css resource. I have to distinguish the filetype for each url and I'm depending on MIME type for that purpose.
response, error := http.Get(url)
if error == nil {
contentType := response.Header.Get("Content-Type")
// ...
}
Only gives me content type.