ajax - In JavaScript, is there a way to retrieve the content-type of a URL without retrieving the entire file? -
i determine if given url image without relying on file's extension. in javascript, there way url's http response headers without retrieving entire contents of file?
you can http head. covered in accessing web page's http headers in javascript
the head method identical except server must not return message-body in response. metainformation contained in http headers in response head request should identical information sent in response request. method can used obtaining metainformation entity implied request without transferring entity-body itself. method used testing hypertext links validity, accessibility, , recent modification.
Comments
Post a Comment