How do you set the Content-Type header for an HttpClient request?
I’m trying to set the Content-Type header of an HttpClient object as required by an API I am calling.
I’m trying to set the Content-Type header of an HttpClient object as required by an API I am calling.
I want to get a MIME Content-Type from a given extension (preferably without accessing the physical file). I have seen some questions about this and the methods described to perform this can be resumed in:
I develop part of an ASP.NET site that uses mostly themes but has a couple of CSS files in the themes folder. These are included in the web.config by another developer like so:
What I’m trying to do here is get the headers of a given URL so I can determine the MIME type. I want to be able to see if http://somedomain/foo/ will return an HTML document or a JPEG image for example. Thus, I need to figure out how to send a HEAD request so that I can read the MIME type without having to download the content. Does anyone know of an easy way of doing this?
I’m trying to process incoming JSON/Ajax requests with Django/Python.