You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When sending a response from a webserver one of the response header values is the MIME type for the file/content we are transfering. For example if someone is requesting a file called cat.png we need to set the key Content-type to image/png.
When sending a response from a webserver one of the response header values is the MIME type for the file/content we are transfering. For example if someone is requesting a file called cat.png we need to set the key Content-type to image/png.
We should have a method that from inspecting a filename and its ending can return the right MIME type for some common image formats, textfiles as html, css and application files as zip and pdf.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types
Input to the method can probably be a filename as a String or maybe a Path object? Overloaded versions?
Where to place methods and in what packet?
The text was updated successfully, but these errors were encountered: