Skip to content

Commit 59acafb

Browse files
committed
Add XMLHttpRequest.overrideMimeType
1 parent 5a502ad commit 59acafb

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/main/scala/org/scalajs/dom/raw/lib.scala

+12-1
Original file line numberDiff line numberDiff line change
@@ -4044,7 +4044,7 @@ class XMLHttpRequest extends EventTarget {
40444044
* is parsed as if it were a text/xml stream. When the responseType is set to "document"
40454045
* and the request has been made asynchronously, the response is parsed as a text/html
40464046
* stream. Note: If the server doesn't apply the text/xml Content-Type header, you
4047-
* can use overrideMimeType()to force XMLHttpRequest to parse it as XML anyway.
4047+
* can use overrideMimeType() to force XMLHttpRequest to parse it as XML anyway.
40484048
*
40494049
* MDN
40504050
*/
@@ -4111,6 +4111,17 @@ class XMLHttpRequest extends EventTarget {
41114111
*/
41124112
def abort(): Unit = js.native
41134113

4114+
/**
4115+
* The XMLHttpRequest method overrideMimeType() specifies a MIME type other than the
4116+
* one provided by the server to be used instead when interpreting the data being
4117+
* transferred in a request. This may be used, for example, to force a stream to be
4118+
* treated and parsed as "text/xml", even if the server does not report it as such.
4119+
* This method must be called before calling send().
4120+
*
4121+
* MDN
4122+
*/
4123+
def overrideMimeType(mimeType: String): Unit = js.native
4124+
41144125
def getAllResponseHeaders(): String = js.native
41154126

41164127
/**

0 commit comments

Comments
 (0)