Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I can't find any info on this. When performing a GET request with the following format, I cant 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? Thanks!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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"
    }
});
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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