1

I can't find any info on this. When performing a GET request with the following format, I can't figure out how to add the request for "overrideMimeType("application/xml")":

request = OpenLayers.Request.GET({
url: "http://aaaaaaaa.com",
async: true,
callback: request_handler,
});

An OpenLayers request like this creates the request object and sends it all in this single code. I know if I weren't using the OpenLayers API, I would do something like:

request.overrideMimeType("application/xml");

But I can't get this to work using using my format.

Any ideas?

1 Answer 1

1

Yoy should use headers property of OpenLayers.Request object:

request = OpenLayers.Request.GET({
    url: "http://aaaaaaaa.com",
    callback: request_handler,
    headers: {
        "Content-Type": "application/xml"
    }
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.